/* ============================================
   TAX GUIDE MODERN CSS FRAMEWORK
   Enhanced with modern design patterns
   ============================================ */

/* ===== CSS RESET & BASE ===== */
*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    /* Color Palette - Modern & Professional */
    --primary: #4361ee;
    --primary-dark: #3a56d4;
    --primary-light: #eef2ff;
    --secondary: #7209b7;
    --accent: #4cc9f0;
    --success: #10b981;
    --warning: #f59e0b;
    --error: #ef4444;
    --info: #3b82f6;
    
    /* Neutrals */
    --dark: #1e293b;
    --dark-light: #334155;
    --gray: #64748b;
    --gray-light: #94a3b8;
    --light: #f8fafc;
    --white: #ffffff;
    
    /* Backgrounds */
    --bg-primary: var(--white);
    --bg-secondary: var(--light);
    --bg-card: var(--white);
    --bg-tooltip: var(--dark);
    
    /* Borders & Shadows */
    --border: #e2e8f0;
    --border-light: #f1f5f9;
    --border-dark: #cbd5e1;
    --shadow-sm: 0 1px 3px 0 rgba(0, 0, 0, 0.1);
    --shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.08);
    --shadow-lg: 0 20px 40px -10px rgba(0, 0, 0, 0.12);
    --shadow-xl: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    
    /* Typography */
    --font-primary: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    --font-mono: 'SF Mono', Monaco, 'Cascadia Code', 'Roboto Mono', monospace;
    
    /* Spacing */
    --space-xs: 0.25rem;
    --space-sm: 0.5rem;
    --space-md: 1rem;
    --space-lg: 1.5rem;
    --space-xl: 2rem;
    --space-2xl: 3rem;
    --space-3xl: 4rem;
    
    /* Border Radius */
    --radius-sm: 4px;
    --radius: 8px;
    --radius-lg: 12px;
    --radius-xl: 16px;
    --radius-full: 9999px;
    
    /* Transitions */
    --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition: 300ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: 500ms cubic-bezier(0.4, 0, 0.2, 1);
    
    /* Z-index layers */
    --z-dropdown: 1000;
    --z-sticky: 1020;
    --z-fixed: 1030;
    --z-modal: 1040;
    --z-popover: 1050;
    --z-tooltip: 1060;
}

/* ===== BASE STYLES ===== */
html {
    scroll-behavior: smooth;
    scroll-padding-top: 80px;
    font-size: 16px;
}

@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }
}

body {
    font-family: var(--font-primary);
    line-height: 1.6;
    color: var(--dark);
    background: var(--bg-primary);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 var(--space-xl);
    width: 100%;
}

.container-fluid {
    width: 100%;
    padding: 0 var(--space-xl);
}

/* ===== TYPOGRAPHY ENHANCEMENTS ===== */
h1, h2, h3, h4, h5, h6 {
    font-weight: 700;
    line-height: 1.2;
    color: var(--dark);
    margin-bottom: var(--space-md);
}

h1 {
    font-size: 3rem;
    letter-spacing: -0.025em;
}

h2 {
    font-size: 2.25rem;
    letter-spacing: -0.02em;
}

h3 {
    font-size: 1.75rem;
    letter-spacing: -0.015em;
}

h4 {
    font-size: 1.25rem;
}

p {
    margin-bottom: var(--space-md);
    color: var(--dark-light);
}

a {
    color: var(--primary);
    text-decoration: none;
    transition: color var(--transition-fast);
}

a:hover {
    color: var(--primary-dark);
    text-decoration: underline;
}

.text-gradient {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* ===== LAYOUT COMPONENTS ===== */
.section {
    padding: var(--space-3xl) 0;
    position: relative;
}

.section-header {
    text-align: center;
    margin-bottom: var(--space-2xl);
    position: relative;
}

.section-subtitle {
    color: var(--gray);
    font-size: 1.125rem;
    max-width: 600px;
    margin: 0 auto;
}

.grid {
    display: grid;
    gap: var(--space-xl);
}

.grid-2 {
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
}

.grid-3 {
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
}

.grid-4 {
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
}

/* ===== HEADER ENHANCEMENTS ===== */
.header {
    background: var(--white);
    box-shadow: var(--shadow);
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: var(--z-sticky);
    backdrop-filter: blur(10px);
    background: rgba(255, 255, 255, 0.95);
}

.header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--space-md) var(--space-xl);
    min-height: 72px;
}

.logo {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
}

.logo-icon {
    font-size: 1.5rem;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.logo h1 {
    font-size: 1.5rem;
    margin: 0;
    font-weight: 800;
}

.logo h1 a {
    color: var(--dark);
    text-decoration: none;
}

.tagline {
    color: var(--gray);
    font-size: 0.875rem;
    font-weight: 500;
}

/* Navigation */
.main-nav ul {
    display: flex;
    list-style: none;
    gap: var(--space-xl);
    align-items: center;
}

.main-nav a {
    color: var(--dark-light);
    font-weight: 600;
    padding: var(--space-sm) 0;
    position: relative;
    text-decoration: none;
}

.main-nav a:hover {
    color: var(--primary);
    text-decoration: none;
}

.main-nav a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--primary);
    transition: width var(--transition);
}

.main-nav a:hover::after {
    width: 100%;
}

.main-nav a.active {
    color: var(--primary);
}

.main-nav a.active::after {
    width: 100%;
}

/* Dropdown */
.dropdown {
    position: relative;
}

.dropdown-content {
    position: absolute;
    top: calc(100% + var(--space-sm));
    left: 0;
    background: var(--white);
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    padding: var(--space-sm) 0;
    min-width: 200px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all var(--transition);
    z-index: var(--z-dropdown);
}

.dropdown:hover .dropdown-content {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.dropdown-content a {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    padding: var(--space-sm) var(--space-lg);
    color: var(--dark-light);
    white-space: nowrap;
}

.dropdown-content a:hover {
    background: var(--light);
    color: var(--primary);
}

/* Mobile Menu */
.mobile-menu-btn {
    display: none;
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--dark);
    padding: var(--space-sm);
}

/* ===== HERO SECTION ===== */
.hero {
    padding: calc(var(--space-3xl) + 72px) 0 var(--space-3xl);
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    color: var(--white);
    position: relative;
    overflow: hidden;
}

.hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(circle at 20% 80%, rgba(255, 255, 255, 0.1) 0%, transparent 50%);
}

.hero-content {
    position: relative;
    z-index: 1;
    text-align: center;
    max-width: 800px;
    margin: 0 auto;
}

.hero h2 {
    font-size: 3.5rem;
    margin-bottom: var(--space-lg);
    color: var(--white);
    line-height: 1.1;
}

.hero p {
    font-size: 1.25rem;
    margin-bottom: var(--space-2xl);
    color: rgba(255, 255, 255, 0.9);
    line-height: 1.6;
}

.hero-stats {
    display: flex;
    justify-content: center;
    gap: var(--space-2xl);
    margin-top: var(--space-2xl);
    flex-wrap: wrap;
}

.stat-item {
    text-align: center;
}

.stat-number {
    font-size: 2.5rem;
    font-weight: 800;
    margin-bottom: var(--space-xs);
    background: linear-gradient(135deg, #ffffff, #e0e7ff);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.stat-label {
    font-size: 0.875rem;
    color: rgba(255, 255, 255, 0.8);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* CTA Buttons */
.cta-buttons {
    display: flex;
    gap: var(--space-md);
    justify-content: center;
    flex-wrap: wrap;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-sm);
    padding: 0.875rem 2rem;
    border-radius: var(--radius);
    font-weight: 600;
    text-decoration: none;
    transition: all var(--transition);
    cursor: pointer;
    border: 2px solid transparent;
    font-size: 1rem;
    position: relative;
    overflow: hidden;
}

.btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.btn:hover::before {
    width: 300px;
    height: 300px;
}

.btn-primary {
    background: var(--white);
    color: var(--primary);
}

.btn-primary:hover {
    background: var(--light);
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.btn-secondary {
    background: transparent;
    color: var(--white);
    border-color: var(--white);
}

.btn-secondary:hover {
    background: var(--white);
    color: var(--primary);
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.btn-outline {
    background: transparent;
    color: var(--white);
    border-color: rgba(255, 255, 255, 0.3);
}

.btn-outline:hover {
    border-color: var(--white);
    background: rgba(255, 255, 255, 0.1);
}

.btn-small {
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
}

/* ===== COUNTRY CARDS ===== */
.country-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: var(--space-xl);
}

.country-card {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    padding: var(--space-xl);
    transition: all var(--transition);
    border: 1px solid var(--border);
    position: relative;
    overflow: hidden;
}

.country-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--primary), var(--accent));
}

.country-card:hover {
    transform: translateY(-8px);
    border-color: var(--primary-light);
    box-shadow: var(--shadow-lg);
}

.country-header {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    margin-bottom: var(--space-lg);
}

.country-flag {
    width: 48px;
    height: 32px;
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-sm);
}

.country-header h3 {
    margin: 0;
    font-size: 1.25rem;
}

.country-meta {
    display: flex;
    gap: var(--space-md);
    margin-bottom: var(--space-md);
    font-size: 0.875rem;
    color: var(--gray);
}

.meta-item {
    display: flex;
    align-items: center;
    gap: var(--space-xs);
}

.country-card p {
    color: var(--gray);
    margin-bottom: var(--space-lg);
    font-size: 0.9375rem;
    line-height: 1.7;
}

/* ===== FEATURE CARDS ===== */
.feature-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: var(--space-xl);
}

.feature-card {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    padding: var(--space-xl);
    text-align: center;
    border: 1px solid var(--border);
    transition: all var(--transition);
}

.feature-card:hover {
    transform: translateY(-5px);
    border-color: var(--primary-light);
    box-shadow: var(--shadow-lg);
}

.feature-icon {
    font-size: 3rem;
    margin-bottom: var(--space-lg);
    display: inline-block;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.feature-card h3 {
    margin-bottom: var(--space-md);
    font-size: 1.25rem;
}

.feature-card p {
    color: var(--gray);
    font-size: 0.9375rem;
}

/* ===== CALCULATOR WIDGET ===== */
.calculator-widget {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    padding: var(--space-xl);
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
}

.calculator-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--space-xl);
    padding-bottom: var(--space-md);
    border-bottom: 2px solid var(--border-light);
}

.calculator-actions {
    display: flex;
    gap: var(--space-sm);
}

.calculator-inputs {
    display: grid;
    gap: var(--space-lg);
    margin-bottom: var(--space-xl);
}

.input-group {
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
}

.input-group label {
    font-weight: 600;
    color: var(--dark);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.input-group input,
.input-group select {
    padding: 0.875rem 1rem;
    border: 2px solid var(--border);
    border-radius: var(--radius);
    font-size: 1rem;
    transition: all var(--transition);
    background: var(--white);
}

.input-group input:focus,
.input-group select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-light);
}

input[type="range"] {
    -webkit-appearance: none;
    width: 100%;
    height: 6px;
    background: var(--border);
    border-radius: 3px;
    outline: none;
}

input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 24px;
    height: 24px;
    background: var(--primary);
    border-radius: 50%;
    cursor: pointer;
    box-shadow: var(--shadow-sm);
    border: 3px solid var(--white);
}

.range-value {
    font-weight: 700;
    color: var(--primary);
    font-size: 1.125rem;
}

/* Results Display */
.calculator-result {
    background: linear-gradient(135deg, var(--light) 0%, #f1f5f9 100%);
    border-radius: var(--radius-lg);
    padding: var(--space-xl);
    text-align: center;
    border: 1px solid var(--border);
}

.result-amount {
    font-size: 3.5rem;
    font-weight: 800;
    color: var(--success);
    margin: var(--space-md) 0;
    line-height: 1;
}

.result-details {
    background: rgba(255, 255, 255, 0.8);
    border-radius: var(--radius);
    padding: var(--space-lg);
    margin: var(--space-lg) 0;
}

.detail-item {
    display: flex;
    justify-content: space-between;
    padding: var(--space-sm) 0;
    border-bottom: 1px solid var(--border-light);
}

.detail-item:last-child {
    border-bottom: none;
}

.result-actions {
    display: flex;
    gap: var(--space-md);
    justify-content: center;
    margin-top: var(--space-xl);
}

/* ===== BLOG CARDS ===== */
.blog-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: var(--space-xl);
}

.blog-card {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    overflow: hidden;
    transition: all var(--transition);
    border: 1px solid var(--border);
}

.blog-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
}

.blog-image {
    width: 100%;
    height: 200px;
    object-fit: cover;
}

.blog-content {
    padding: var(--space-xl);
}

.blog-meta {
    display: flex;
    gap: var(--space-md);
    margin-bottom: var(--space-md);
    font-size: 0.875rem;
    color: var(--gray);
}

.blog-card h3 {
    margin-bottom: var(--space-md);
    font-size: 1.25rem;
}

.blog-card p {
    color: var(--gray);
    margin-bottom: var(--space-lg);
    font-size: 0.9375rem;
}

/* ===== AFFILIATE SECTION ===== */
.affiliate-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: var(--space-xl);
}

.affiliate-card {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    overflow: hidden;
    border: 1px solid var(--border);
    transition: all var(--transition);
}

.affiliate-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
}

.affiliate-badge {
    position: absolute;
    top: var(--space-md);
    right: var(--space-md);
    background: var(--warning);
    color: var(--white);
    padding: 0.25rem 0.75rem;
    border-radius: var(--radius-full);
    font-size: 0.75rem;
    font-weight: 600;
}

.affiliate-content {
    padding: var(--space-xl);
}

.rating {
    display: flex;
    align-items: center;
    gap: var(--space-xs);
    margin: var(--space-sm) 0;
}

.stars {
    color: #fbbf24;
}

.review-count {
    color: var(--gray);
    font-size: 0.875rem;
}

.pricing {
    margin: var(--space-md) 0;
}

.price {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--dark);
}

.discount {
    background: var(--success);
    color: var(--white);
    padding: 0.25rem 0.5rem;
    border-radius: var(--radius-sm);
    font-size: 0.875rem;
    font-weight: 600;
    margin-left: var(--space-sm);
}

/* ===== FAQ SECTION ===== */
.faq-grid {
    max-width: 800px;
    margin: 0 auto;
}

.faq-item {
    background: var(--bg-card);
    border-radius: var(--radius);
    margin-bottom: var(--space-md);
    border: 1px solid var(--border);
    overflow: hidden;
    transition: all var(--transition);
}

.faq-item:hover {
    border-color: var(--primary-light);
}

.faq-question {
    padding: var(--space-lg);
    font-weight: 600;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: var(--dark);
}

.faq-question::after {
    content: '+';
    font-size: 1.25rem;
    transition: transform var(--transition);
}

.faq-item.active .faq-question::after {
    transform: rotate(45deg);
}

.faq-answer {
    padding: 0 var(--space-lg);
    max-height: 0;
    overflow: hidden;
    transition: all var(--transition);
    color: var(--gray);
}

.faq-item.active .faq-answer {
    padding-bottom: var(--space-lg);
    max-height: 500px;
}

/* ===== TOOLTIP ===== */
.tooltip {
    position: relative;
    display: inline-block;
}

.tooltip-text {
    position: absolute;
    bottom: 125%;
    left: 50%;
    transform: translateX(-50%);
    background: var(--bg-tooltip);
    color: var(--white);
    padding: var(--space-sm) var(--space-md);
    border-radius: var(--radius);
    font-size: 0.875rem;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: all var(--transition);
    z-index: var(--z-tooltip);
}

.tooltip-text::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border-width: 6px;
    border-style: solid;
    border-color: var(--bg-tooltip) transparent transparent transparent;
}

.tooltip:hover .tooltip-text {
    opacity: 1;
    visibility: visible;
}

/* ===== BADGES ===== */
.badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: var(--radius-full);
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.badge-primary {
    background: var(--primary-light);
    color: var(--primary);
}

.badge-success {
    background: #d1fae5;
    color: #065f46;
}

.badge-warning {
    background: #fef3c7;
    color: #92400e;
}

.badge-error {
    background: #fee2e2;
    color: #991b1b;
}

/* ===== FOOTER ENHANCEMENTS ===== */
.footer {
    background: var(--dark);
    color: var(--white);
    padding: var(--space-3xl) 0 var(--space-xl);
    position: relative;
}

.footer::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--primary), var(--accent));
}

.footer-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: var(--space-2xl);
    margin-bottom: var(--space-2xl);
}

.footer-col h4 {
    color: var(--white);
    margin-bottom: var(--space-lg);
    font-size: 1.125rem;
}

.footer-col p {
    color: var(--gray-light);
    margin-bottom: var(--space-md);
    font-size: 0.875rem;
}

.footer-col ul {
    list-style: none;
}

.footer-col ul li {
    margin-bottom: var(--space-sm);
}

.footer-col a {
    color: var(--gray-light);
    text-decoration: none;
    transition: color var(--transition);
    font-size: 0.875rem;
}

.footer-col a:hover {
    color: var(--white);
}

.newsletter-form {
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
}

.newsletter-form input,
.newsletter-form select {
    padding: 0.75rem 1rem;
    border: 1px solid #374151;
    border-radius: var(--radius);
    background: #1f2937;
    color: var(--white);
    font-size: 0.875rem;
}

.newsletter-form button {
    padding: 0.75rem 1.5rem;
    background: var(--primary);
    color: var(--white);
    border: none;
    border-radius: var(--radius);
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition);
}

.newsletter-form button:hover {
    background: var(--primary-dark);
}

.footer-bottom {
    text-align: center;
    padding-top: var(--space-xl);
    border-top: 1px solid #374151;
    color: var(--gray-light);
    font-size: 0.75rem;
}

/* ===== UTILITY CLASSES ===== */
.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }

.mt-1 { margin-top: var(--space-sm); }
.mt-2 { margin-top: var(--space-md); }
.mt-3 { margin-top: var(--space-lg); }
.mt-4 { margin-top: var(--space-xl); }

.mb-1 { margin-bottom: var(--space-sm); }
.mb-2 { margin-bottom: var(--space-md); }
.mb-3 { margin-bottom: var(--space-lg); }
.mb-4 { margin-bottom: var(--space-xl); }

.p-1 { padding: var(--space-sm); }
.p-2 { padding: var(--space-md); }
.p-3 { padding: var(--space-lg); }
.p-4 { padding: var(--space-xl); }

.hidden { display: none; }
.flex { display: flex; }
.grid-display { display: grid; }
.block { display: block; }
.inline-block { display: inline-block; }

.items-center { align-items: center; }
.justify-center { justify-content: center; }
.justify-between { justify-content: space-between; }
.flex-col { flex-direction: column; }
.flex-wrap { flex-wrap: wrap; }

.gap-1 { gap: var(--space-sm); }
.gap-2 { gap: var(--space-md); }
.gap-3 { gap: var(--space-lg); }
.gap-4 { gap: var(--space-xl); }

.rounded-sm { border-radius: var(--radius-sm); }
.rounded { border-radius: var(--radius); }
.rounded-lg { border-radius: var(--radius-lg); }
.rounded-full { border-radius: var(--radius-full); }

.shadow-sm { box-shadow: var(--shadow-sm); }
.shadow { box-shadow: var(--shadow); }
.shadow-lg { box-shadow: var(--shadow-lg); }

.bg-primary { background: var(--primary); }
.bg-secondary { background: var(--secondary); }
.bg-light { background: var(--light); }
.bg-dark { background: var(--dark); }

.text-primary { color: var(--primary); }
.text-secondary { color: var(--secondary); }
.text-light { color: var(--gray-light); }
.text-dark { color: var(--dark); }
.text-white { color: var(--white); }

/* ===== ANIMATIONS ===== */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translateX(-30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

@keyframes float {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-10px);
    }
}

.animate-fadeIn {
    animation: fadeIn 0.6s ease-out;
}

.animate-slideInLeft {
    animation: slideInLeft 0.6s ease-out;
}

.animate-slideInRight {
    animation: slideInRight 0.6s ease-out;
}

.animate-pulse {
    animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

.animate-float {
    animation: float 3s ease-in-out infinite;
}

/* ===== DARK MODE ===== */
@media (prefers-color-scheme: dark) {
    :root {
        --bg-primary: #0f172a;
        --bg-secondary: #1e293b;
        --bg-card: #1e293b;
        --dark: #f1f5f9;
        --dark-light: #cbd5e1;
        --gray: #94a3b8;
        --border: #334155;
        --border-light: #475569;
    }
    
    .header {
        background: rgba(15, 23, 42, 0.95);
        backdrop-filter: blur(10px);
    }
    
    .footer {
        background: #0f172a;
    }
    
    input,
    select,
    textarea {
        background: #1e293b;
        border-color: #334155;
        color: #f1f5f9;
    }
}

/* ===== RESPONSIVE DESIGN ===== */
@media (max-width: 1024px) {
    h1 { font-size: 2.5rem; }
    h2 { font-size: 2rem; }
    h3 { font-size: 1.5rem; }
    
    .hero h2 {
        font-size: 2.75rem;
    }
}

@media (max-width: 768px) {
    .container {
        padding: 0 var(--space-lg);
    }
    
    .main-nav {
        display: none;
    }
    
    .mobile-menu-btn {
        display: block;
    }
    
    .mobile-nav {
        display: block;
        position: fixed;
        top: 72px;
        left: 0;
        right: 0;
        background: var(--bg-primary);
        box-shadow: var(--shadow-lg);
        padding: var(--space-lg);
        z-index: var(--z-dropdown);
    }
    
    .mobile-nav ul {
        flex-direction: column;
        gap: var(--space-md);
    }
    
    .mobile-nav a {
        padding: var(--space-sm) 0;
        display: block;
    }
    
    .hero h2 {
        font-size: 2rem;
    }
    
    .hero p {
        font-size: 1.125rem;
    }
    
    .hero-stats {
        gap: var(--space-lg);
    }
    
    .stat-number {
        font-size: 2rem;
    }
    
    .cta-buttons {
        flex-direction: column;
        align-items: stretch;
    }
    
    .btn {
        width: 100%;
        justify-content: center;
    }
    
    .grid-2,
    .grid-3,
    .grid-4 {
        grid-template-columns: 1fr;
    }
    
    .country-grid,
    .feature-grid,
    .blog-grid,
    .affiliate-grid {
        grid-template-columns: 1fr;
    }
    
    .footer-grid {
        grid-template-columns: 1fr;
        gap: var(--space-xl);
    }
}

@media (max-width: 480px) {
    :root {
        font-size: 14px;
    }
    
    .container {
        padding: 0 var(--space-md);
    }
    
    .hero {
        padding: calc(var(--space-2xl) + 72px) 0 var(--space-2xl);
    }
    
    .section {
        padding: var(--space-2xl) 0;
    }
    
    .calculator-header {
        flex-direction: column;
        gap: var(--space-md);
        text-align: center;
    }
    
    .calculator-actions {
        width: 100%;
        justify-content: center;
    }
}

/* ===== PRINT STYLES ===== */
@media print {
    .header,
    .footer,
    .hero,
    .ads-section,
    .affiliate-tools,
    .calculator-actions,
    .result-actions,
    .cta-buttons,
    .mobile-menu-btn {
        display: none !important;
    }
    
    body {
        font-size: 12pt;
        color: #000;
        background: #fff;
    }
    
    .container {
        max-width: 100%;
        padding: 0;
    }
    
    a {
        color: #000;
        text-decoration: underline;
    }
    
    .calculator-widget,
    .country-card,
    .blog-card,
    .affiliate-card {
        break-inside: avoid;
        box-shadow: none !important;
        border: 1px solid #ddd !important;
    }
}

/* ===== COUNTRY PAGE SPECIFIC ===== */
.country-page {
    padding: calc(72px + var(--space-xl)) 0 var(--space-3xl);
}

.breadcrumb {
    margin-bottom: var(--space-xl);
    font-size: 0.875rem;
    color: var(--gray);
}

.breadcrumb a {
    color: var(--gray);
    text-decoration: none;
}

.breadcrumb a:hover {
    color: var(--primary);
}

.country-page h1 {
    font-size: 3rem;
    margin-bottom: var(--space-md);
    line-height: 1.2;
}

.meta-info {
    display: flex;
    gap: var(--space-lg);
    color: var(--gray);
    margin-bottom: var(--space-xl);
    font-size: 0.875rem;
}

.requirement-list {
    display: grid;
    gap: var(--space-lg);
    margin: var(--space-xl) 0;
}

.requirement-item {
    background: var(--light);
    padding: var(--space-xl);
    border-radius: var(--radius);
    border-left: 4px solid var(--primary);
}

.method-comparison {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: var(--space-xl);
    margin: var(--space-xl) 0;
}

.method {
    background: var(--white);
    border: 2px solid var(--border);
    border-radius: var(--radius-lg);
    padding: var(--space-xl);
}

.method.simplified {
    border-color: var(--primary);
}

.method.regular {
    border-color: var(--success);
}

.rate-box {
    text-align: center;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: var(--white);
    padding: var(--space-lg);
    border-radius: var(--radius);
    margin: var(--space-md) 0;
}

.rate-box strong {
    font-size: 2rem;
    display: block;
}

.affiliate-recommendation {
    background: linear-gradient(135deg, #f0f9ff, #e0f2fe);
    border-radius: var(--radius-lg);
    padding: var(--space-xl);
    margin: var(--space-xl) 0;
    border: 2px solid var(--accent);
}

.calculation-example {
    background: #f8fafc;
    border: 2px dashed #cbd5e1;
    border-radius: var(--radius);
    padding: var(--space-xl);
    margin: var(--space-xl) 0;
}

.warning-box {
    background: #fef2f2;
    border: 2px solid #ef4444;
    border-radius: var(--radius);
    padding: var(--space-lg);
    margin: var(--space-xl) 0;
}

.warning-box h4 {
    color: #dc2626;
    margin-bottom: var(--space-md);
}

.cta-box {
    text-align: center;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: var(--white);
    padding: var(--space-2xl);
    border-radius: var(--radius-lg);
    margin: var(--space-xl) 0;
}

.share-section {
    text-align: center;
    margin: var(--space-xl) 0;
    padding: var(--space-xl);
    background: var(--light);
    border-radius: var(--radius);
}

/* ===== ACCESSIBILITY ===== */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

:focus {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}

:focus:not(:focus-visible) {
    outline: none;
}

:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}

/* ===== CUSTOM SCROLLBAR ===== */
::-webkit-scrollbar {
    width: 10px;
}

::-webkit-scrollbar-track {
    background: var(--light);
}

::-webkit-scrollbar-thumb {
    background: var(--primary);
    border-radius: var(--radius-full);
}

::-webkit-scrollbar-thumb:hover {
    background: var(--primary-dark);
}

/* ===== LOADING STATES ===== */
.loading {
    position: relative;
    overflow: hidden;
}

.loading::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(255, 255, 255, 0.4),
        transparent
    );
    animation: loading 1.5s infinite;
}

@keyframes loading {
    0% {
        transform: translateX(-100%);
    }
    100% {
        transform: translateX(100%);
    }
}

/* ===== COUNTRY-SPECIFIC FLAG COLORS ===== */
.flag-usa {
    background: linear-gradient(to bottom, #B31942 0% 50%, white 50% 100%);
    border: 1px solid #0A3161;
}

.flag-uk {
    background: linear-gradient(45deg, #012169 0% 50%, #C8102E 50% 100%);
}

.flag-germany {
    background: linear-gradient(to bottom, #000000 0% 33%, #dd0000 33% 66%, #ffcc00 66% 100%);
}

.flag-france {
    background: linear-gradient(to right, #0055A4 0% 33%, white 33% 66%, #EF4135 66% 100%);
}

.flag-spain {
    background: linear-gradient(to bottom, #AA151B 0% 25%, #F1BF00 25% 75%, #AA151B 75% 100%);
}

/* ===== PAGINATION ===== */
.pagination {
    display: flex;
    justify-content: center;
    gap: var(--space-sm);
    margin: var(--space-2xl) 0;
}

.pagination-item {
    padding: 0.5rem 1rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--gray);
    text-decoration: none;
    transition: all var(--transition);
}

.pagination-item:hover {
    background: var(--light);
    border-color: var(--primary);
    color: var(--primary);
}

.pagination-item.active {
    background: var(--primary);
    border-color: var(--primary);
    color: var(--white);
}

.pagination-ellipsis {
    padding: 0.5rem 1rem;
    color: var(--gray);
    user-select: none;
}

/* ===== PROGRESS BAR ===== */
.progress-bar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--primary), var(--accent));
    transform-origin: 0%;
    z-index: var(--z-tooltip);
}

/* ===== BACK TO TOP ===== */
.back-to-top {
    position: fixed;
    bottom: var(--space-xl);
    right: var(--space-xl);
    width: 50px;
    height: 50px;
    background: var(--primary);
    color: var(--white);
    border: none;
    border-radius: var(--radius-full);
    cursor: pointer;
    opacity: 0;
    visibility: hidden;
    transition: all var(--transition);
    z-index: var(--z-fixed);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    box-shadow: var(--shadow-lg);
}

.back-to-top.visible {
    opacity: 1;
    visibility: visible;
}

.back-to-top:hover {
    background: var(--primary-dark);
    transform: translateY(-3px);
}

/* ===== CODE BLOCKS ===== */
.code-block {
    background: var(--dark);
    color: var(--white);
    padding: var(--space-lg);
    border-radius: var(--radius);
    font-family: var(--font-mono);
    font-size: 0.875rem;
    overflow-x: auto;
    margin: var(--space-lg) 0;
}

/* ===== MODAL ===== */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: var(--z-modal);
    opacity: 0;
    visibility: hidden;
    transition: all var(--transition);
}

.modal.active {
    opacity: 1;
    visibility: visible;
}

.modal-content {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    padding: var(--space-xl);
    max-width: 500px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    transform: translateY(20px);
    transition: transform var(--transition);
}

.modal.active .modal-content {
    transform: translateY(0);
}

.modal-close {
    position: absolute;
    top: var(--space-md);
    right: var(--space-md);
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--gray);
}

/* ===== NOTIFICATION ===== */
.notification {
    position: fixed;
    top: var(--space-xl);
    right: var(--space-xl);
    background: var(--white);
    border-radius: var(--radius);
    padding: var(--space-lg);
    box-shadow: var(--shadow-lg);
    border-left: 4px solid var(--success);
    transform: translateX(100%);
    transition: transform var(--transition);
    z-index: var(--z-popover);
    max-width: 400px;
}

.notification.show {
    transform: translateX(0);
}

.notification.error {
    border-left-color: var(--error);
}

.notification.warning {
    border-left-color: var(--warning);
}

.notification.info {
    border-left-color: var(--info);
}

/* ===== STEPPER ===== */
.stepper {
    display: flex;
    justify-content: space-between;
    position: relative;
    margin: var(--space-2xl) 0;
}

.stepper::before {
    content: '';
    position: absolute;
    top: 20px;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--border);
    z-index: 1;
}

.step {
    position: relative;
    z-index: 2;
    text-align: center;
    flex: 1;
}

.step-number {
    width: 40px;
    height: 40px;
    background: var(--white);
    border: 2px solid var(--border);
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto var(--space-sm);
    font-weight: 600;
    transition: all var(--transition);
}

.step.active .step-number {
    background: var(--primary);
    border-color: var(--primary);
    color: var(--white);
}

.step.completed .step-number {
    background: var(--success);
    border-color: var(--success);
    color: var(--white);
}

.step-label {
    font-size: 0.875rem;
    color: var(--gray);
}

.step.active .step-label {
    color: var(--primary);
    font-weight: 600;
}

/* ===== TIMELINE ===== */
.timeline {
    position: relative;
    padding-left: var(--space-2xl);
    margin: var(--space-2xl) 0;
}

.timeline::before {
    content: '';
    position: absolute;
    left: 7px;
    top: 0;
    bottom: 0;
    width: 2px;
    background: var(--border);
}

.timeline-item {
    position: relative;
    margin-bottom: var(--space-xl);
}

.timeline-item::before {
    content: '';
    position: absolute;
    left: -25px;
    top: 5px;
    width: 12px;
    height: 12px;
    border-radius: var(--radius-full);
    background: var(--primary);
    border: 3px solid var(--white);
    box-shadow: 0 0 0 3px var(--primary);
}

.timeline-date {
    font-weight: 600;
    color: var(--primary);
    margin-bottom: var(--space-xs);
}

/* ===== YEAR BADGES ===== */
.year-badge {
    font-size: 0.75rem;
    padding: 0.25rem 0.75rem;
    border-radius: var(--radius-full);
    background: linear-gradient(135deg, var(--accent), var(--primary));
    color: var(--white);
    font-weight: 600;
    margin-left: var(--space-sm);
}

.year-range {
    background: var(--light);
    color: var(--primary);
    padding: 0.25rem 0.75rem;
    border-radius: var(--radius-full);
    font-size: 0.75rem;
    font-weight: 600;
}

/* ===== QUICK NAV ===== */
.quick-nav {
    background: var(--light);
    padding: var(--space-lg);
    border-radius: var(--radius);
    margin: var(--space-xl) 0;
}

.quick-nav-links {
    display: flex;
    gap: var(--space-md);
    flex-wrap: wrap;
    margin-top: var(--space-md);
}

.quick-nav-links a {
    padding: 0.75rem 1.5rem;
    background: var(--white);
    border-radius: var(--radius);
    text-decoration: none;
    color: var(--primary);
    font-weight: 600;
    border: 2px solid transparent;
    transition: all var(--transition);
}

.quick-nav-links a:hover {
    border-color: var(--primary);
    transform: translateY(-2px);
    box-shadow: var(--shadow);
}

/* ===== ADVERTISEMENTS ===== */
.ad-container {
    background: var(--light);
    border-radius: var(--radius);
    padding: var(--space-lg);
    margin: var(--space-xl) 0;
    text-align: center;
    min-height: 90px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.ad-label {
    font-size: 0.75rem;
    color: var(--gray);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: var(--space-sm);
    text-align: center;
}

/* ===== HIGHLIGHT BOX ===== */
.highlight-box {
    background: linear-gradient(135deg, var(--primary-light), #e0f2fe);
    border: 2px solid var(--primary);
    border-radius: var(--radius-lg);
    padding: var(--space-xl);
    margin: var(--space-xl) 0;
    position: relative;
}

.highlight-icon {
    position: absolute;
    top: -20px;
    left: -20px;
    background: var(--primary);
    color: var(--white);
    width: 40px;
    height: 40px;
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
}

/* ===== COMPARISON TABLE ===== */
.comparison-table {
    width: 100%;
    border-collapse: collapse;
    margin: var(--space-xl) 0;
}

.comparison-table th {
    background: var(--primary);
    color: var(--white);
    padding: var(--space-lg);
    text-align: left;
    font-weight: 600;
}

.comparison-table td {
    padding: var(--space-lg);
    border-bottom: 1px solid var(--border);
}

.comparison-table tr:hover {
    background: var(--light);
}

/* ===== FINAL TOUCHES ===== */
::selection {
    background: var(--primary-light);
    color: var(--primary-dark);
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

iframe {
    max-width: 100%;
}

/* ===== PERFORMANCE OPTIMIZATIONS ===== */
.will-change-transform {
    will-change: transform;
}

.will-change-opacity {
    will-change: opacity;
}

.content-visibility-auto {
    content-visibility: auto;
}

/* ===== THEME TOGGLE ===== */
.theme-toggle {
    background: none;
    border: none;
    cursor: pointer;
    padding: var(--space-sm);
    border-radius: var(--radius);
    color: var(--gray);
    transition: all var(--transition);
}

.theme-toggle:hover {
    background: var(--light);
    color: var(--primary);
}

/* ===== CUSTOM PROPERTIES FOR JAVASCRIPT ===== */
:root {
    --header-height: 72px;
    --mobile-breakpoint: 768px;
    --tablet-breakpoint: 1024px;
}

/* ===== PRINT OPTIMIZATIONS ===== */
@media print {
    .no-print {
        display: none !important;
    }
    
    .print-only {
        display: block !important;
    }
    
    a[href]:after {
        content: " (" attr(href) ")";
    }
    
    .break-after {
        break-after: page;
    }
    
    .break-before {
        break-before: page;
    }
    
    .break-inside-avoid {
        break-inside: avoid;
    }
}

/* ===== RESPONSIVE SPACING ===== */
@media (max-width: 768px) {
    .responsive-spacing {
        --space-xl: 1.5rem;
        --space-2xl: 2.5rem;
        --space-3xl: 3rem;
    }
}

/* ===== FLEX UTILITIES ===== */
.flex-1 { flex: 1; }
.flex-auto { flex: auto; }
.flex-initial { flex: initial; }
.flex-none { flex: none; }

/* ===== GRID UTILITIES ===== */
.grid-cols-1 { grid-template-columns: 1fr; }
.grid-cols-2 { grid-template-columns: repeat(2, 1fr); }
.grid-cols-3 { grid-template-columns: repeat(3, 1fr); }
.grid-cols-4 { grid-template-columns: repeat(4, 1fr); }

.col-span-2 { grid-column: span 2; }
.col-span-3 { grid-column: span 3; }

.row-span-2 { grid-row: span 2; }
.row-span-3 { grid-row: span 3; }

/* ===== VISIBILITY ===== */
.visible { visibility: visible; }
.invisible { visibility: hidden; }

/* ===== OPACITY ===== */
.opacity-0 { opacity: 0; }
.opacity-25 { opacity: 0.25; }
.opacity-50 { opacity: 0.5; }
.opacity-75 { opacity: 0.75; }
.opacity-100 { opacity: 1; }

/* ===== TRANSFORMS ===== */
.transform { transform: translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y)); }
.translate-y-0 { --tw-translate-y: 0px; }
.translate-y-1 { --tw-translate-y: 0.25rem; }
.translate-y-2 { --tw-translate-y: 0.5rem; }
.translate-y-4 { --tw-translate-y: 1rem; }

/* ===== TRANSITIONS ===== */
.transition-all { transition-property: all; }
.transition-colors { transition-property: color, background-color, border-color; }
.transition-transform { transition-property: transform; }

.duration-150 { transition-duration: 150ms; }
.duration-300 { transition-duration: 300ms; }
.duration-500 { transition-duration: 500ms; }

.ease-in { transition-timing-function: cubic-bezier(0.4, 0, 1, 1); }
.ease-out { transition-timing-function: cubic-bezier(0, 0, 0.2, 1); }
.ease-in-out { transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1); }

/* ===== INTERACTIVE ELEMENTS ===== */
.interactive {
    cursor: pointer;
    user-select: none;
}

.interactive:hover {
    transform: translateY(-2px);
}

.interactive:active {
    transform: translateY(0);
}

/* ===== SCROLL SNAP ===== */
.scroll-snap-container {
    scroll-snap-type: x mandatory;
    overflow-x: auto;
    display: flex;
    gap: var(--space-md);
    padding: var(--space-md) 0;
}

.scroll-snap-item {
    scroll-snap-align: start;
    flex: 0 0 auto;
}

/* ===== ASPECT RATIO ===== */
.aspect-square { aspect-ratio: 1; }
.aspect-video { aspect-ratio: 16 / 9; }
.aspect-auto { aspect-ratio: auto; }

/* ===== OBJECT FIT ===== */
.object-contain { object-fit: contain; }
.object-cover { object-fit: cover; }
.object-fill { object-fit: fill; }
.object-none { object-fit: none; }
.object-scale-down { object-fit: scale-down; }

/* ===== OVERFLOW ===== */
.overflow-auto { overflow: auto; }
.overflow-hidden { overflow: hidden; }
.overflow-visible { overflow: visible; }
.overflow-scroll { overflow: scroll; }
.overflow-x-auto { overflow-x: auto; }
.overflow-y-auto { overflow-y: auto; }

/* ===== WHITESPACE ===== */
.whitespace-normal { white-space: normal; }
.whitespace-nowrap { white-space: nowrap; }
.whitespace-pre { white-space: pre; }
.whitespace-pre-line { white-space: pre-line; }
.whitespace-pre-wrap { white-space: pre-wrap; }

/* ===== WORD BREAK ===== */
.break-normal { overflow-wrap: normal; word-break: normal; }
.break-words { overflow-wrap: break-word; }
.break-all { word-break: break-all; }

/* ===== LINE CLAMP ===== */
.line-clamp-1 {
    overflow: hidden;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 1;
}

.line-clamp-2 {
    overflow: hidden;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
}

.line-clamp-3 {
    overflow: hidden;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 3;
}

/* ===== CLEARFIX ===== */
.clearfix::after {
    content: "";
    clear: both;
    display: table;
}

/* ===== FINAL ENHANCEMENTS ===== */
.placeholder {
    background: linear-gradient(
        90deg,
        var(--border) 25%,
        var(--border-light) 50%,
        var(--border) 75%
    );
    background-size: 200% 100%;
    animation: loading 1.5s infinite;
}

@keyframes shimmer {
    0% {
        background-position: -200% 0;
    }
    100% {
        background-position: 200% 0;
    }
}

.skeleton {
    background: linear-gradient(
        90deg,
        var(--border) 25%,
        var(--border-light) 50%,
        var(--border) 75%
    );
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
}

/* ===== CONTEXTUAL COLORS ===== */
.context-primary { color: var(--primary); }
.context-success { color: var(--success); }
.context-warning { color: var(--warning); }
.context-error { color: var(--error); }
.context-info { color: var(--info); }

/* ===== RESPONSIVE TYPOGRAPHY ===== */
.text-responsive {
    font-size: clamp(1rem, 2.5vw, 1.5rem);
}

.heading-responsive {
    font-size: clamp(1.5rem, 5vw, 3rem);
}

/* ===== FLEX ORDER ===== */
.order-first { order: -9999; }
.order-last { order: 9999; }
.order-none { order: 0; }

/* ===== Z-INDEX UTILITIES ===== */
.z-0 { z-index: 0; }
.z-10 { z-index: 10; }
.z-20 { z-index: 20; }
.z-30 { z-index: 30; }
.z-40 { z-index: 40; }
.z-50 { z-index: 50; }
.z-auto { z-index: auto; }

/* ===== LIST STYLING ===== */
.list-none { list-style: none; }
.list-disc { list-style: disc; }
.list-decimal { list-style: decimal; }
.list-inside { list-style-position: inside; }
.list-outside { list-style-position: outside; }

/* ===== TABLE STYLING ===== */
.table-auto { table-layout: auto; }
.table-fixed { table-layout: fixed; }
.table-caption { caption-side: top; }

/* ===== FORM CONTROLS ===== */
.form-input {
    @extend .input-group input;
}

.form-select {
    @extend .input-group select;
}

.form-checkbox {
    width: 1.25rem;
    height: 1.25rem;
    border: 2px solid var(--border);
    border-radius: var(--radius-sm);
    cursor: pointer;
}

.form-radio {
    width: 1.25rem;
    height: 1.25rem;
    border: 2px solid var(--border);
    border-radius: var(--radius-full);
    cursor: pointer;
}

/* ===== CUSTOM PROPERTY FALLBACKS ===== */
@supports not (color: color(display-p3 1 1 1)) {
    :root {
        --primary: #4361ee;
        --secondary: #7209b7;
    }
}

/* ===== PREFERS-REDUCED-MOTION ===== */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

/* ===== PREFERS-CONTRAST ===== */
@media (prefers-contrast: high) {
    :root {
        --primary: #0044cc;
        --secondary: #5a00b3;
    }
}

/* ===== PREFERS-COLOR-SCHEME ===== */
@media (prefers-color-scheme: dark) {
    .dark\:hidden {
        display: none;
    }
    
    .dark\:block {
        display: block;
    }
}

/* ===== PRINT SPECIFIC ===== */
@media print {
    .print\:hidden {
        display: none !important;
    }
    
    .print\:block {
        display: block !important;
    }
    
    .print\:text-black {
        color: #000 !important;
    }
}

/* ===== RESPONSIVE UTILITIES ===== */
@media (min-width: 640px) {
    .sm\:block { display: block; }
    .sm\:hidden { display: none; }
}

@media (min-width: 768px) {
    .md\:block { display: block; }
    .md\:hidden { display: none; }
}

@media (min-width: 1024px) {
    .lg\:block { display: block; }
    .lg\:hidden { display: none; }
}

@media (min-width: 1280px) {
    .xl\:block { display: block; }
    .xl\:hidden { display: none; }
}

/* ===== FINAL OPTIMIZATIONS ===== */
@media (hover: hover) {
    .hover\:scale-105:hover {
        transform: scale(1.05);
    }
    
    .hover\:scale-110:hover {
        transform: scale(1.1);
    }
}

/* ===== TOUCH DEVICE OPTIMIZATIONS ===== */
@media (pointer: coarse) {
    .touch\:text-lg {
        font-size: 1.125rem;
    }
    
    .touch\:p-3 {
        padding: var(--space-lg);
    }
}

/* ===== HIGH DPI DISPLAYS ===== */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    .retina\:border-2 {
        border-width: 2px;
    }
}

/* ===== ORIENTATION SPECIFIC ===== */
@media (orientation: portrait) {
    .portrait\:flex-col {
        flex-direction: column;
    }
}

@media (orientation: landscape) {
    .landscape\:flex-row {
        flex-direction: row;
    }
}

/* ===== ANIMATION PERFORMANCE ===== */
.transform-gpu {
    transform: translateZ(0);
    backface-visibility: hidden;
    perspective: 1000px;
}

/* ===== ACCESSIBILITY FOCUS RINGS ===== */
.focus\:ring:focus {
    outline: 2px solid transparent;
    outline-offset: 2px;
    box-shadow: 0 0 0 3px var(--primary-light);
}

/* ===== CUSTOM PROPERTY OVERRIDES ===== */
@property --primary {
    syntax: '<color>';
    inherits: true;
    initial-value: #4361ee;
}

@property --secondary {
    syntax: '<color>';
    inherits: true;
    initial-value: #7209b7;
}

/* ===== PERFORMANCE CLASSES ===== */
.will-change {
    will-change: transform, opacity;
}

/* ===== CONTENT VISIBILITY ===== */
.content-visibility-auto {
    content-visibility: auto;
    contain-intrinsic-size: 0 500px;
}

/* ===== SCROLL MARGIN ===== */
.scroll-mt-20 {
    scroll-margin-top: 5rem;
}

/* ===== SMOOTH SCROLLING ===== */
html {
    scroll-behavior: smooth;
}

/* ===== FONT LOADING ===== */
.font-loading {
    font-display: swap;
}

/* ===== IMAGE OPTIMIZATION ===== */
img {
    content-visibility: auto;
}

/* ===== LAZY LOADING ===== */
.lazy-load {
    opacity: 0;
    transition: opacity 0.3s;
}

.lazy-loaded {
    opacity: 1;
}

/* ===== FINAL MEDIA QUERY ===== */
@media (max-width: 360px) {
    .xs\:hidden {
        display: none;
    }
    
    .xs\:block {
        display: block;
    }
}

/* ===== END OF STYLESHEET ===== */