/**
 * UI Components Styles
 * 
 * Preloader, Back-to-Top, Breadcrumbs, and other UI elements.
 * 
 * @package GrowthSheriff
 * @since 1.0.0
 */

/* ==========================================================================
   Variables
   ========================================================================== */
:root {
    --preloader-color: var(--primary-color, #6254E7);
    --preloader-bg: #fff;
    --back-to-top-size: 50px;
}

/* ==========================================================================
   PRELOADER
   ========================================================================== */
.preloader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--preloader-bg);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 999999;
    transition: opacity 0.5s ease, visibility 0.5s ease;
}

.preloader.loaded {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.preloader__content {
    text-align: center;
}

/* Spinner Preloader */
.preloader-spinner {
    width: 60px;
    height: 60px;
}

.preloader-spinner svg {
    animation: preloader-rotate 2s linear infinite;
}

.preloader-spinner circle {
    stroke: var(--preloader-color);
    stroke-linecap: round;
    stroke-dasharray: 1, 200;
    stroke-dashoffset: 0;
    animation: preloader-dash 1.5s ease-in-out infinite;
}

@keyframes preloader-rotate {
    100% {
        transform: rotate(360deg);
    }
}

@keyframes preloader-dash {
    0% {
        stroke-dasharray: 1, 200;
        stroke-dashoffset: 0;
    }
    50% {
        stroke-dasharray: 89, 200;
        stroke-dashoffset: -35px;
    }
    100% {
        stroke-dasharray: 89, 200;
        stroke-dashoffset: -124px;
    }
}

/* Dots Preloader */
.preloader-dots {
    display: flex;
    gap: 8px;
}

.preloader-dots span {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: var(--preloader-color);
    animation: preloader-bounce 1.4s ease-in-out infinite both;
}

.preloader-dots span:nth-child(1) {
    animation-delay: -0.32s;
}

.preloader-dots span:nth-child(2) {
    animation-delay: -0.16s;
}

@keyframes preloader-bounce {
    0%, 80%, 100% {
        transform: scale(0);
    }
    40% {
        transform: scale(1);
    }
}

/* Pulse Preloader */
.preloader-pulse {
    position: relative;
    width: 80px;
    height: 80px;
}

.preloader-pulse .pulse-ring {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 60px;
    height: 60px;
    margin: -30px 0 0 -30px;
    border-radius: 50%;
    border: 3px solid var(--preloader-color);
    animation: preloader-pulse 1.25s cubic-bezier(0.215, 0.61, 0.355, 1) infinite;
}

.preloader-pulse .pulse-ring:nth-child(2) {
    animation-delay: 0.4s;
}

.preloader-pulse .pulse-ring:nth-child(3) {
    animation-delay: 0.8s;
}

@keyframes preloader-pulse {
    0% {
        opacity: 1;
        transform: scale(0);
    }
    100% {
        opacity: 0;
        transform: scale(1);
    }
}

/* Logo Preloader */
.preloader-logo {
    max-width: 120px;
    height: auto;
    margin-bottom: 20px;
    animation: preloader-logo-pulse 2s ease-in-out infinite;
}

.preloader-text {
    display: block;
    font-size: 28px;
    font-weight: 700;
    color: var(--preloader-color);
    margin-bottom: 20px;
    animation: preloader-logo-pulse 2s ease-in-out infinite;
}

@keyframes preloader-logo-pulse {
    0%, 100% {
        opacity: 1;
        transform: scale(1);
    }
    50% {
        opacity: 0.7;
        transform: scale(0.95);
    }
}

.preloader-progress {
    width: 200px;
    height: 4px;
    background: rgba(0, 0, 0, 0.1);
    border-radius: 2px;
    overflow: hidden;
    margin: 0 auto;
}

.preloader-progress-bar {
    height: 100%;
    width: 0;
    background: var(--preloader-color);
    border-radius: 2px;
    animation: preloader-progress 2s ease-out forwards;
}

@keyframes preloader-progress {
    0% {
        width: 0;
    }
    100% {
        width: 100%;
    }
}

/* ==========================================================================
   BACK TO TOP
   ========================================================================== */
.back-to-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: var(--back-to-top-size);
    height: var(--back-to-top-size);
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--primary-color, #6254E7);
    color: #fff;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px);
    transition: all 0.3s ease;
    z-index: 9999;
    box-shadow: 0 4px 20px rgba(98, 84, 231, 0.4);
}

.back-to-top.visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.back-to-top:hover {
    background: var(--secondary-color, #F2295B);
    transform: translateY(-5px);
    box-shadow: 0 8px 30px rgba(242, 41, 91, 0.4);
}

.back-to-top__icon {
    display: flex;
    align-items: center;
    justify-content: center;
}

.back-to-top__icon svg {
    width: 20px;
    height: 20px;
}

/* Back to Top - Square Style */
.back-to-top--square {
    border-radius: 8px;
}

/* Back to Top - Progress Style */
.back-to-top--progress {
    background: transparent;
    position: relative;
}

.back-to-top--progress .back-to-top__icon {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 35px;
    height: 35px;
    background: var(--primary-color, #6254E7);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1;
}

.back-to-top--progress .back-to-top__icon svg {
    width: 16px;
    height: 16px;
}

.back-to-top__progress {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    transform: rotate(-90deg);
}

.back-to-top__progress circle {
    fill: none;
    stroke: rgba(0, 0, 0, 0.1);
    stroke-width: 6;
    transition: stroke-dashoffset 0.1s ease;
}

.back-to-top__progress circle:last-child {
    stroke: var(--primary-color, #6254E7);
    stroke-dasharray: 283;
    stroke-dashoffset: 283;
}

.back-to-top--progress:hover .back-to-top__icon {
    background: var(--secondary-color, #F2295B);
}

/* ==========================================================================
   BREADCRUMBS
   ========================================================================== */
.breadcrumb {
    padding: 15px 0;
    font-size: 14px;
}

.breadcrumb__list {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    margin: 0;
    padding: 0;
    list-style: none;
    gap: 8px;
}

.breadcrumb__item {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text-color, #525c7a);
}

.breadcrumb__item a {
    color: var(--text-color, #525c7a);
    text-decoration: none;
    transition: color 0.3s ease;
}

.breadcrumb__item a:hover {
    color: var(--primary-color, #6254E7);
}

.breadcrumb__item--current {
    color: var(--primary-color, #6254E7);
    font-weight: 600;
}

.breadcrumb__separator {
    color: #ccc;
    font-weight: 400;
}

/* Breadcrumb Variations */
.breadcrumb--light {
    background: rgba(255, 255, 255, 0.1);
    padding: 12px 20px;
    border-radius: 8px;
}

.breadcrumb--light .breadcrumb__item,
.breadcrumb--light .breadcrumb__item a {
    color: rgba(255, 255, 255, 0.8);
}

.breadcrumb--light .breadcrumb__item--current {
    color: #fff;
}

.breadcrumb--light .breadcrumb__separator {
    color: rgba(255, 255, 255, 0.4);
}

.breadcrumb--boxed {
    background: #f8f9fa;
    padding: 15px 25px;
    border-radius: 8px;
}

/* ==========================================================================
   SCROLL PROGRESS BAR
   ========================================================================== */
.scroll-progress {
    position: fixed;
    top: 0;
    left: 0;
    width: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--primary-color, #6254E7), var(--secondary-color, #F2295B));
    z-index: 99999;
    transition: width 0.1s ease;
}

/* ==========================================================================
   PAGE TITLE SECTION
   ========================================================================== */
.page-title-section {
    background: linear-gradient(135deg, #1d2145 0%, #2a2f5a 100%);
    padding: 80px 0;
    margin-bottom: 60px;
    position: relative;
    overflow: hidden;
}

.page-title-section::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(98, 84, 231, 0.15) 0%, transparent 70%);
    animation: page-title-glow 10s ease-in-out infinite;
}

@keyframes page-title-glow {
    0%, 100% {
        transform: translate(0, 0);
    }
    50% {
        transform: translate(10%, 10%);
    }
}

.page-title-section .container {
    position: relative;
    z-index: 1;
}

.page-title-section__title {
    font-size: clamp(2rem, 4vw, 3.5rem);
    font-weight: 700;
    color: #fff;
    margin-bottom: 15px;
}

.page-title-section__subtitle {
    font-size: 18px;
    color: rgba(255, 255, 255, 0.7);
    max-width: 600px;
}

.page-title-section .breadcrumb {
    margin-top: 20px;
}

.page-title-section .breadcrumb__item,
.page-title-section .breadcrumb__item a {
    color: rgba(255, 255, 255, 0.7);
}

.page-title-section .breadcrumb__item--current {
    color: #fff;
}

.page-title-section .breadcrumb__separator {
    color: rgba(255, 255, 255, 0.4);
}

/* ==========================================================================
   NOTIFICATION TOAST
   ========================================================================== */
.notification-toast {
    position: fixed;
    top: 20px;
    right: 20px;
    max-width: 350px;
    padding: 16px 24px;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
    transform: translateX(120%);
    transition: transform 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    z-index: 999999;
    display: flex;
    align-items: center;
    gap: 12px;
}

.notification-toast.show {
    transform: translateX(0);
}

.notification-toast__icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.notification-toast--success .notification-toast__icon {
    background: #e8f5e9;
    color: #28a745;
}

.notification-toast--error .notification-toast__icon {
    background: #ffebee;
    color: #dc3545;
}

.notification-toast--info .notification-toast__icon {
    background: #e3f2fd;
    color: #2196f3;
}

.notification-toast__content {
    flex: 1;
}

.notification-toast__title {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-dark, #1d2145);
    margin-bottom: 4px;
}

.notification-toast__message {
    font-size: 13px;
    color: var(--text-color, #525c7a);
}

.notification-toast__close {
    width: 24px;
    height: 24px;
    border: none;
    background: transparent;
    color: #999;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.3s ease;
}

.notification-toast__close:hover {
    color: #333;
}

/* ==========================================================================
   RESPONSIVE
   ========================================================================== */
@media (max-width: 767px) {
    .back-to-top {
        bottom: 20px;
        right: 20px;
        width: 45px;
        height: 45px;
    }
    
    .page-title-section {
        padding: 60px 0;
        margin-bottom: 40px;
    }
    
    .breadcrumb {
        font-size: 13px;
    }
}
