/* 
 * GLOBAL STYLESHEET
 * This file contains all reusable styles for consistent design across the site
 * Individual page styles should only contain page-specific overrides and unique components
 */

/* ----- RESET & CORE STYLES ----- */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font-family-primary);
    font-size: var(--text-base);
    font-weight: var(--font-normal);
    line-height: var(--leading-relaxed);
    background-color: var(--bg-primary);
    color: var(--text-secondary);
    padding-top: 0;
    margin: 0;
    transition: var(--transition-colors);
}

a {
    color: var(--text-link);
    text-decoration: none;
    transition: var(--transition-colors);
}

a:hover {
    color: var(--text-link-hover);
}

.h1, .h2, .h3, .h4, .h5, .h6, h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-family-primary);
    font-weight: var(--font-bold);
    line-height: var(--leading-tight);
    color: var(--text-primary);
    margin: 0 0 var(--space-4);
    transition: var(--transition-colors);
}

h1, .h1 { font-size: var(--text-4xl); }
h2, .h2 { font-size: var(--text-3xl); }
h3, .h3 { font-size: var(--text-2xl); }
h4, .h4 { font-size: var(--text-xl); }
h5, .h5 { font-size: var(--text-lg); }
h6, .h6 { font-size: var(--text-base); }

/* ----- LAYOUT & CONTAINERS ----- */
.container {
    max-width: var(--container-max);
    padding: 0 var(--space-4);
}

main {
    min-height: calc(100vh - var(--header-height) - var(--footer-height));
    margin-top: var(--header-height);
}

.section {
    padding: var(--space-20) 0;
    position: relative;
}

.section > .container {
    position: relative;
    z-index: var(--z-10);
}

/* ----- SECTION BACKGROUND VARIANTS ----- */
.section-primary {
    background: var(--bg-gradient);
    transition: var(--transition-colors);
}

.section-secondary {
    background: var(--bg-tertiary);
    transition: var(--transition-colors);
}

.section-dark {
    background-color: var(--bg-secondary);
    transition: var(--transition-colors);
}

/* ----- SECTION HEADERS ----- */
.section-title {
    font-family: var(--font-family-primary);
    font-size: var(--text-4xl);
    font-weight: var(--font-bold);
    line-height: var(--leading-tight);
    margin-bottom: var(--space-12);
    text-align: center;
    position: relative;
    color: var(--text-primary);
    transition: var(--transition-colors);
}

.section-title:after {
    content: '';
    position: absolute;
    width: var(--space-20);
    height: var(--border-width-4);
    background: var(--primary);
    bottom: calc(-1 * var(--space-4));
    left: 50%;
    transform: translateX(-50%);
    border-radius: var(--radius-base);
}

.section-subtitle {
    font-family: var(--font-family-primary);
    font-size: var(--text-lg);
    font-weight: var(--font-normal);
    line-height: var(--leading-relaxed);
    color: var(--text-secondary);
    margin-bottom: var(--space-8);
    text-align: center;
    max-width: var(--container-md);
    margin-left: auto;
    margin-right: auto;
    transition: var(--transition-colors);
}

/* ----- GRID LAYOUTS ----- */
.services-grid,
.testimonials-grid,
.plans-grid,
.features-grid,
.results-grid,
.bundles-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: var(--space-8);
    position: relative;
    padding-top: var(--space-6);
    z-index: var(--z-10);
}

.custom-fields-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: var(--space-5);
}

/* ----- UTILITY CLASSES ----- */
.tag {
    display: inline-block;
    padding: var(--space-1_5) var(--space-4);
    background: var(--border-subtle);
    color: var(--primary);
    border-radius: var(--radius-pill);
    font-family: var(--font-family-primary);
    font-size: var(--text-sm);
    font-weight: var(--font-semibold);
    letter-spacing: var(--tracking-wide);
    margin-bottom: var(--space-4);
    transition: var(--transition-colors);
}

.text-primary {
    color: var(--primary) !important;
}

.text-secondary {
    color: var(--text-secondary) !important;
}

/* ----- ANIMATIONS ----- */
@keyframes pulse-glow {
    0% {
        opacity: 0.3;
    }
    100% {
        opacity: 0.6;
    }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes shine {
    0% {
        opacity: 0;
        left: -100%;
    }
    20% {
        opacity: 1;
    }
    100% {
        opacity: 0;
        left: 150%;
    }
}

/* === HEADER STYLES === */
header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1000;
    background: var(--header-bg);
    backdrop-filter: blur(10px);
    transition: all 0.3s ease;
    box-shadow: var(--shadow-navbar);
}

[data-theme="dark"] header {
    background: var(--header-bg);
}

header.sticky {
    background: var(--header-bg);
}

[data-theme="dark"] header.sticky {
    background: var(--header-bg);
}

header.slide-up {
    transform: translateY(-100%);
}

header.slide-down {
    transform: translateY(0);
}

.navbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--space-4) 0;
    position: relative;
}

/* Theme-aware SVG logo styling */
.logo-svg {
    height: 42px;
    width: auto;
    max-width: 225px;
    transition: transform 0.2s ease;
}

/* Logo theme switching - show/hide based on theme */
[data-theme="light"] .light-theme-logo {
    display: block;
}

[data-theme="light"] .dark-theme-logo {
    display: none;
}

[data-theme="dark"] .light-theme-logo {
    display: none;
}

[data-theme="dark"] .dark-theme-logo {
    display: block;
}

/* Logo hover effect */
.logo:hover .logo-svg {
    transform: translateY(-1px);
}

/* Responsive logo sizing */
@media (max-width: 768px) {
    .logo-svg {
        height: 35px;
        max-width: 150px;
    }
}

@media (max-width: 480px) {
    .logo-svg {
        height: 30px;
        max-width: 120px;
    }
}

.nav-links {
    display: flex;
    align-items: center;
    list-style: none;
    margin: 0;
    padding: 0;
}

.nav-links li {
    margin: 0 var(--space-4);
}

.nav-links a {
    color: var(--text-primary);
    text-decoration: none;
    font-weight: var(--font-medium);
    position: relative;
    padding: var(--space-2) 0;
    transition: color 0.3s ease;
}

.nav-links a:hover {
    color: var(--primary);
}

.nav-links a:after {
    content: '';
    position: absolute;
    width: 100%;
    height: 2px;
    bottom: 0;
    left: 0;
    background-color: var(--primary);
    transform: scaleX(0);
    transform-origin: bottom right;
    transition: transform 0.3s ease;
}

.nav-links a:hover:after {
    transform: scaleX(1);
    transform-origin: bottom left;
}

.mobile-menu {
    display: none;
    cursor: pointer;
    font-size: var(--text-xl);
    color: var(--text-primary);
}

.header-actions {
    display: flex;
    align-items: center;
    gap: var(--space-3);
}

/* User Dropdown Styles */
.user-dropdown {
    position: relative;
}

.dropdown-toggle::after {
    color: var(--icon-primary);
}

.user-dropdown .user-info {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    background: none;
    border: none;
    padding: 0;
    cursor: pointer;
    transition: all 0.3s ease;
}

.user-dropdown .user-avatar {
    width: 45px;
    height: 45px;
    border-radius: var(--radius-full);
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--primary-50);
    border: 2px solid var(--primary-100);
    transition: all 0.3s ease;
}

.user-dropdown .user-avatar:hover {
    border-color: var(--primary);
    transform: translateY(-1px);
}

.user-dropdown .user-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.user-dropdown .user-avatar i {
    font-size: var(--text-xl);
    color: var(--primary);
}

/* Dropdown Menu Container */
.user-dropdown .dropdown-menu {
    position: absolute;
    top: 100%;
    right: 0;
    min-width: 240px;
    padding: var(--space-2);
    margin-top: var(--space-2);
    background: var(--rev-card-bg);
    border: none;
    border-radius: var(--radius-2xl);
    box-shadow: var(--shadow-dropdown);
    visibility: hidden;
    opacity: 0;
    transform: translateY(-8px) scale(0.98);
    transform-origin: top right;
    transition: all 0.2s cubic-bezier(0.165, 0.84, 0.44, 1);
    pointer-events: none;
    /* Prevent layout shift */
    backface-visibility: hidden;
    will-change: transform, opacity, visibility;
}

.user-dropdown .dropdown-menu.show {
    visibility: visible;
    opacity: 1;
    transform: translateY(0) scale(1);
    pointer-events: auto;
}

.user-dropdown .dropdown-header {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    padding: var(--space-3);
    border-bottom: 1px solid var(--border-subtle);
    margin-bottom: var(--space-1);
}

.user-dropdown .user-dropdown-avatar {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-full);
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--primary-50);
    border: 2px solid var(--primary-100);
}

.user-dropdown .dropdown-avatar-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.user-dropdown .dropdown-avatar-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--primary-50);
}

.user-dropdown .dropdown-avatar-placeholder i {
    font-size: var(--text-xl);
    color: var(--primary);
}

.user-dropdown .user-dropdown-info {
    display: flex;
    flex-direction: column;
    min-width: 0; /* Enable text truncation */
}

.user-dropdown .user-dropdown-info strong {
    color: var(--text-primary);
    font-size: var(--text-base);
    line-height: 1.2;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.user-dropdown .user-dropdown-info small {
    color: var(--text-secondary) !important;
    font-size: var(--text-sm);
}

.user-dropdown .dropdown-divider {
    margin: var(--space-1) 0;
    border-top: 1px solid var(--border-subtle);
    opacity: 0.1;
}

.user-dropdown .dropdown-item {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    padding: var(--space-2) var(--space-3);
    color: var(--text-primary);
    font-size: var(--text-sm);
    text-decoration: none;
    border-radius: var(--radius-lg);
    transition: all 0.2s ease;
    margin: 2px var(--space-1);
}

.user-dropdown .dropdown-item i {
    width: 16px;
    text-align: center;
    color: var(--text-secondary);
    transition: color 0.2s ease;
}

.user-dropdown .dropdown-item:hover {
    background: var(--primary-50);
    color: var(--primary);
}

.user-dropdown .dropdown-item:hover i {
    color: var(--primary);
}

.user-dropdown .dropdown-item.text-danger {
    color: var(--danger);
}

.user-dropdown .dropdown-item.text-danger:hover {
    background: var(--danger-light);
}

.user-dropdown .dropdown-item.text-danger:hover i {
    color: var(--danger);
}

/* Header Actions - Layout Only */
.header-actions .text-primary {
    color: var(--primary) !important;
}

.header-actions .text-secondary {
    color: var(--secondary) !important;
}

/* ----- ANIMATIONS ----- */
@keyframes pulse-glow {
    0% {
        opacity: 0.3;
    }
    100% {
        opacity: 0.6;
    }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes shine {
    0% {
        opacity: 0;
        left: -100%;
    }
    20% {
        opacity: 1;
    }
    100% {
        opacity: 0;
        left: 150%;
    }
}

/* ----- FOOTER ----- */
footer {
    background-color: var(--footer-bg);
    padding: var(--space-16) 0 var(--space-8);
    position: relative;
    transition: var(--transition-colors);
    box-shadow: var(--shadow-lg);
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: var(--space-10);
    margin-bottom: var(--space-10);
}

.footer-column {
    text-align: left;
}

.footer-column h3 {
    font-family: var(--font-family-primary);
    font-size: var(--text-xl);
    font-weight: var(--font-semibold);
    margin-bottom: var(--space-5);
    color: var(--text-primary);
    position: relative;
    transition: var(--transition-colors);
}

.footer-column h3:after {
    content: '';
    position: absolute;
    left: 0;
    bottom: calc(-1 * var(--space-2));
    width: var(--space-10);
    height: var(--border-width-2);
    background: var(--primary);
    border-radius: var(--radius-base);
}

.footer-links {
    list-style: none;
    padding: 0;
    margin: 0;
}

.footer-links li {
    margin-bottom: var(--space-2_5);
}

.footer-links a {
    font-family: var(--font-family-primary);
    font-size: var(--text-base);
    color: var(--text-secondary);
    transition: var(--transition-colors);
    text-decoration: none;
}

.footer-links a:hover {
    color: var(--primary);
}

.footer-bottom {
    border-top: var(--border-width) solid var(--border-tertiary);
    padding-top: var(--space-8);
    text-align: center;
    color: var(--text-secondary);
}

.footer-bottom-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 20px;
}

.footer-bottom-content p {
    margin: 0;
}

/* ----- RESPONSIVE DESIGN ----- */
@media (max-width: 992px) {
    .section-title {
        font-size: var(--text-3xl);
        margin-bottom: var(--space-10);
    }

    .plan-card {
        padding: var(--space-6) var(--space-5);
    }

    .plans-grid,
    .testimonials-grid,
    .services-grid {
        grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
        gap: var(--space-6);
    }

    .features-grid,
    .results-grid {
        grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
        gap: var(--space-6);
    }

    .social-links-header {
        display: none;
    }

    .form-row {
        grid-template-columns: 1fr;
        gap: var(--space-4);
    }
}

@media (max-width: 768px) {
    .nav-links {
        position: fixed;
        top: var(--header-height);
        left: -100%;
        width: 100%;
        height: calc(100vh - var(--header-height));
        background: var(--bg-overlay);
        backdrop-filter: blur(10px);
        -webkit-backdrop-filter: blur(10px);
        flex-direction: column;
        justify-content: flex-start;
        align-items: center;
        padding: var(--space-12) 0;
        transition: var(--transition-all);
        gap: var(--space-5);
        z-index: var(--z-modal);
    }

    .nav-links.active {
        left: 0;
    }

    .nav-links li {
        margin: 0;
    }

    .mobile-menu {
        display: block;
    }

    .header-actions {
        margin-left: var(--space-3);
    }

    .header-actions .btn {
        padding: var(--space-1_5) var(--space-3);
        font-size: var(--text-xs);
    }

    .auth-buttons {
        gap: var(--space-1_5);
    }
    
    .footer-bottom-content {
        flex-direction: column;
        text-align: center;
        gap: var(--space-4);
    }
    
    .theme-toggle {
        justify-content: center;
    }

    .cta-buttons {
        justify-content: center;
        gap: var(--space-2_5);
    }

    .section {
        padding: var(--space-16) 0;
    }

    .services-grid,
    .plans-grid,
    .testimonials-grid,
    .features-grid,
    .results-grid {
        grid-template-columns: 1fr;
        gap: var(--space-5);
    }

    .section-header {
        flex-direction: column;
        text-align: center;
        gap: var(--space-2_5);
    }

    .section-icon {
        margin: 0 auto;
    }

    .notification-content {
        flex-direction: column;
        gap: var(--space-4);
        text-align: center;
    }

    .form-options {
        flex-direction: column;
        align-items: flex-start;
        gap: var(--space-2_5);
    }

    .container-header {
        padding: var(--space-8) var(--space-5) var(--space-5);
    }

    .container-content {
        padding: 0 var(--space-5) var(--space-8);
    }

    .form-section {
        padding: var(--space-5);
    }

    .tab-btn span {
        display: none;
    }

    .tab-btn {
        padding: var(--space-3);
    }

    /* Enhanced form mobile adjustments */
    .input-wrapper .form-control,
    .form-control {
        padding: var(--space-2_5) var(--space-3);
        font-size: 16px; /* Prevents zoom on iOS */
    }

    .password-toggle {
        right: var(--space-3);
        top: 50%;
        transform: translateY(-50%);
        font-size: var(--text-sm);
    }

    /* Password toggle for forms with visible labels on mobile */
    .input-wrapper:has(label:not(.sr-only)) .password-toggle {
        top: 48px;
        transform: none;
    }
}

@media (max-width: 576px) {
    .section-title {
        font-size: var(--text-2xl);
        margin-bottom: var(--space-8);
    }

    .section-subtitle {
        font-size: var(--text-base);
        margin-bottom: var(--space-6);
    }

    .container {
        padding: 0 var(--space-2_5);
    }

    .section {
        padding: var(--space-12) 0;
    }

    .cta-buttons {
        flex-direction: column;
        align-items: center;
        gap: var(--space-3);
    }
}