/* ============================================================
   Canada.28 - Custom Stylesheet
   Design: Minimalist Tech Style, Blue-600 palette
   ============================================================ */

/* ---------- CSS Variables ---------- */
:root {
    --brand-50: #eff6ff;
    --brand-100: #dbeafe;
    --brand-200: #bfdbfe;
    --brand-300: #93c5fd;
    --brand-400: #60a5fa;
    --brand-500: #3b82f6;
    --brand-600: #2563eb;
    --brand-700: #1d4ed8;
    --brand-800: #1e40af;
    --brand-900: #1e3a8a;
    --text-primary: #111827;
    --text-secondary: #4b5563;
    --text-muted: #9ca3af;
    --border-light: #e5e7eb;
    --bg-light: #f9fafb;
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
    --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);
    --transition-base: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-smooth: 0.5s cubic-bezier(0.22, 1, 0.36, 1);
}

/* ---------- Smooth Scrolling ---------- */
html {
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ---------- Selection ---------- */
::selection {
    background-color: var(--brand-600);
    color: #ffffff;
}

/* ---------- Navbar ---------- */
#navbar {
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-bottom: 1px solid transparent;
}

#navbar.scrolled {
    background: rgba(255, 255, 255, 0.95);
    border-bottom-color: var(--border-light);
    box-shadow: var(--shadow-sm);
}

.nav-link {
    position: relative;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 50%;
    transform: translateX(-50%) scaleX(0);
    width: 100%;
    height: 2px;
    background: var(--brand-600);
    border-radius: 2px;
    transition: transform var(--transition-base);
}

.nav-link:hover::after {
    transform: translateX(-50%) scaleX(1);
}

/* ---------- Hero Dashboard ---------- */
#dashboard {
    animation: dashboard-float 6s ease-in-out infinite;
}

@keyframes dashboard-float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-8px); }
}

/* Mini chart bars */
.chart-bar {
    width: 100%;
    border-radius: 4px 4px 0 0;
    background: linear-gradient(180deg, var(--brand-600) 0%, var(--brand-400) 100%);
    transition: height 0.6s cubic-bezier(0.22, 1, 0.36, 1);
    min-height: 4px;
    position: relative;
}

.chart-bar::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: rgba(255, 255, 255, 0.4);
    border-radius: 4px 4px 0 0;
}

.chart-bar.highlight {
    background: linear-gradient(180deg, #3b82f6 0%, #818cf8 100%);
    box-shadow: 0 0 8px rgba(59, 130, 246, 0.4);
}

/* ---------- Feature Cards ---------- */
.feature-card {
    position: relative;
    padding: 2px;
    border-radius: 1rem;
    background: linear-gradient(135deg, #e5e7eb 0%, #f3f4f6 50%, #e5e7eb 100%);
    transition: all var(--transition-base);
}

.feature-card:hover {
    background: linear-gradient(135deg, var(--brand-400), var(--brand-600), #818cf8);
    transform: translateY(-4px);
    box-shadow: 0 20px 40px -12px rgba(37, 99, 235, 0.25);
}

.feature-card-inner {
    position: relative;
    background: #ffffff;
    border-radius: calc(1rem - 2px);
    padding: 2rem 1.75rem;
    height: 100%;
    transition: all var(--transition-base);
}

.feature-card:hover .feature-card-inner {
    background: rgba(255, 255, 255, 0.98);
}

.feature-icon-wrapper {
    width: 48px;
    height: 48px;
    background: var(--brand-50);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1.25rem;
    transition: all var(--transition-base);
}

.feature-icon-wrapper i {
    font-size: 1.25rem;
    color: var(--brand-600);
    transition: all var(--transition-base);
}

.feature-card:hover .feature-icon-wrapper {
    background: var(--brand-600);
}

.feature-card:hover .feature-icon-wrapper i {
    color: #ffffff;
}

/* ---------- Circular Progress ---------- */
.stat-item {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.circular-progress {
    position: relative;
    width: 140px;
    height: 140px;
}

.circular-progress-svg {
    width: 100%;
    height: 100%;
    transform: rotate(-90deg);
}

.circular-progress-bg {
    transition: none;
}

.circular-progress-fill {
    transition: stroke-dashoffset 1.5s cubic-bezier(0.22, 1, 0.36, 1);
}

.circular-progress-text {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.circular-progress-value {
    font-size: 1.75rem;
    font-weight: 800;
    color: var(--text-primary);
    line-height: 1;
    display: flex;
    align-items: baseline;
    gap: 1px;
}

.circular-progress-value span {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-secondary);
}

/* ---------- Testimonials ---------- */
.testimonial-card {
    position: relative;
    transition: all var(--transition-base);
}

.testimonial-card::before {
    content: '"';
    position: absolute;
    top: 1.5rem;
    right: 1.5rem;
    font-size: 3rem;
    font-weight: 800;
    color: var(--brand-100);
    line-height: 1;
    pointer-events: none;
    font-family: Georgia, serif;
}

/* ---------- FAQ Items ---------- */
.faq-item {
    transition: all var(--transition-base);
}

.faq-item:hover {
    background: #f8fafc;
    border-color: var(--brand-200);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.04);
}

.faq-answer {
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    transition: all 0.4s cubic-bezier(0.22, 1, 0.36, 1);
}

.faq-item:hover .faq-answer,
.faq-item.active .faq-answer {
    max-height: 200px;
    opacity: 1;
    margin-top: 0.5rem;
    display: block !important;
}

.faq-item.active {
    background: #f8fafc;
    border-color: var(--brand-300);
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.08);
}

.faq-item.active i.fa-chevron-right {
    transform: rotate(90deg);
    color: var(--brand-600);
}

/* ---------- Back to Top ---------- */
#back-to-top.visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

#back-to-top:hover {
    transform: translateY(-3px);
}

/* ---------- Scroll-triggered animations ---------- */
[data-animate] {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.8s cubic-bezier(0.22, 1, 0.36, 1),
                transform 0.8s cubic-bezier(0.22, 1, 0.36, 1);
}

[data-animate].animate-visible {
    opacity: 1;
    transform: translateY(0);
}

/* Stagger children animations */
[data-animate] > .feature-card,
[data-animate] > .stat-item,
[data-animate] > .testimonial-card,
[data-animate] > .faq-item {
    opacity: 0;
    transform: translateY(24px);
}

[data-animate].animate-visible > .feature-card:nth-child(1),
[data-animate].animate-visible > .stat-item:nth-child(1),
[data-animate].animate-visible > .testimonial-card:nth-child(1) {
    transition-delay: 0.05s;
}

[data-animate].animate-visible > .feature-card:nth-child(2),
[data-animate].animate-visible > .stat-item:nth-child(2) {
    transition-delay: 0.12s;
}

[data-animate].animate-visible > .feature-card:nth-child(3),
[data-animate].animate-visible > .stat-item:nth-child(3),
[data-animate].animate-visible > .testimonial-card:nth-child(3) {
    transition-delay: 0.19s;
}

[data-animate].animate-visible > .feature-card:nth-child(4),
[data-animate].animate-visible > .stat-item:nth-child(4) {
    transition-delay: 0.26s;
}

[data-animate].animate-visible > .feature-card:nth-child(5) {
    transition-delay: 0.33s;
}

[data-animate].animate-visible > .feature-card:nth-child(6) {
    transition-delay: 0.4s;
}

[data-animate].animate-visible > .feature-card,
[data-animate].animate-visible > .stat-item,
[data-animate].animate-visible > .testimonial-card {
    opacity: 1;
    transform: translateY(0);
    transition: opacity 0.6s cubic-bezier(0.22, 1, 0.36, 1),
                transform 0.6s cubic-bezier(0.22, 1, 0.36, 1);
}

/* ---------- Scrollbar ---------- */
::-webkit-scrollbar {
    width: 6px;
}

::-webkit-scrollbar-track {
    background: var(--bg-light);
}

::-webkit-scrollbar-thumb {
    background: var(--brand-300);
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--brand-500);
}

/* ---------- Responsive Adjustments ---------- */
@media (max-width: 1023px) {
    #dashboard {
        animation: none;
    }

    .circular-progress {
        width: 110px;
        height: 110px;
    }

    .circular-progress-value {
        font-size: 1.4rem;
    }

    .circular-progress-value span {
        font-size: 0.75rem;
    }
}

@media (max-width: 767px) {
    .feature-card-inner {
        padding: 1.5rem 1.25rem;
    }

    .circular-progress {
        width: 90px;
        height: 90px;
    }

    .circular-progress-value {
        font-size: 1.2rem;
    }

    .circular-progress-value span {
        font-size: 0.7rem;
    }

    .circular-progress-svg circle {
        stroke-width: 6;
    }

    #dashboard {
        max-width: 100%;
    }
}

/* ---------- Focus & Accessibility ---------- */
a:focus-visible,
button:focus-visible {
    outline: 2px solid var(--brand-600);
    outline-offset: 2px;
    border-radius: 4px;
}

/* ---------- Print Styles ---------- */
@media print {
    #navbar,
    #back-to-top,
    #mobile-menu {
        display: none !important;
    }

    [data-animate] {
        opacity: 1 !important;
        transform: none !important;
    }
}