/**
 * MAIN STYLES - MUC Banking Application
 * Main application styles and layout
 */

/* ===== DESIGN SYSTEM VARIABLES ===== */
:root {
    /* === BRAND COLORS === */
    --brand-primary: #0056b3;          /* MUC Blue - WCAG AAA compliant (darker for accessibility) */
    --brand-secondary: #6c757d;        /* Gray */
    --brand-accent: #28a745;           /* Success Green */
    --brand-warning: #ffc107;          /* Warning Amber */
    --brand-danger: #dc3545;           /* Error Red */
    --brand-info: #17a2b8;             /* Info Cyan */

    /* === COLOR PALETTE === */
    /* Primary Colors */
    --color-primary-light: #66b3ff;
    --color-primary: var(--brand-primary);
    --color-primary-dark: #0056b3;

    /* Semantic Colors */
    --color-success: var(--brand-accent);
    --color-success-light: #5cb85c;
    --color-success-dark: #1e7e34;

    --color-warning: var(--brand-warning);
    --color-warning-light: #ffdb4d;
    --color-warning-dark: #cc9a00;

    --color-danger: var(--brand-danger);
    --color-danger-light: #e57373;
    --color-danger-dark: #b71c1c;

    --color-info: var(--brand-info);
    --color-info-light: #5bc0de;
    --color-info-dark: #117a8b;

    /* === NEUTRAL COLORS === */
    --color-white: #ffffff;
    --color-light: #f8f9fa;
    --color-lighter: #f1f3f4;
    --color-gray-100: #f8f9fa;
    --color-gray-200: #e9ecef;
    --color-gray-300: #dee2e6;
    --color-gray-400: #ced4da;
    --color-gray-500: #adb5bd;
    --color-gray-600: #6c757d;
    --color-gray-700: #495057;
    --color-gray-800: #343a40;
    --color-gray-900: #212529;
    --color-dark: var(--color-gray-800);
    --color-black: #000000;

    /* === BACKGROUND COLORS === */
    --color-background: var(--color-white);
    --color-background-alt: var(--color-light);
    --color-surface: var(--color-white);
    --color-surface-alt: var(--color-lighter);

    /* === TEXT COLORS === */
    --color-text-primary: var(--color-gray-900);
    --color-text-secondary: var(--color-gray-600);
    --color-text-muted: var(--color-gray-500);
    --color-text-disabled: var(--color-gray-400);
    --color-text-inverse: var(--color-white);

    /* === BORDER COLORS === */
    --color-border: var(--color-gray-300);
    --color-border-light: var(--color-gray-200);
    --color-border-dark: var(--color-gray-400);

    /* === TYPOGRAPHY === */
    --font-family-sans: 'Segoe UI', system-ui, -apple-system, BlinkMacSystemFont, 'Helvetica Neue', Arial, sans-serif;
    --font-family-mono: 'SF Mono', Consolas, 'Liberation Mono', Menlo, Monaco, 'Courier New', monospace;
    --font-family: var(--font-family-sans);

    /* Font Sizes */
    --font-size-xs: 0.75rem;    /* 12px */
    --font-size-sm: 0.875rem;   /* 14px */
    --font-size-base: 1rem;     /* 16px */
    --font-size-lg: 1.125rem;   /* 18px */
    --font-size-xl: 1.25rem;    /* 20px */
    --font-size-2xl: 1.5rem;    /* 24px */
    --font-size-3xl: 2rem;      /* 32px */
    --font-size-4xl: 2.25rem;    /* 40px */

    /* Font Weights */
    --font-weight-light: 300;
    --font-weight-normal: 400;
    --font-weight-medium: 500;
    --font-weight-semibold: 600;
    --font-weight-bold: 700;

    /* Line Heights */
    --line-height-tight: 1.25;
    --line-height-base: 1.5;
    --line-height-relaxed: 1.75;

    /* === SPACING === */
    --space-1: 0.25rem;   /* 4px */
    --space-2: 0.5rem;    /* 8px */
    --space-3: 0.75rem;   /* 12px */
    --space-4: 1rem;      /* 16px */
    --space-5: 1.25rem;   /* 20px */
    --space-6: 1.5rem;    /* 24px */
    --space-8: 2rem;      /* 32px */
    --space-10: 2.5rem;   /* 40px */
    --space-12: 3rem;     /* 48px */
    --space-16: 4rem;     /* 64px */
    --space-20: 5rem;     /* 80px */

    /* === BORDERS & RADIUS === */
    --border-width: 1px;
    --border-width-thick: 2px;
    --border-style: solid;

    --border-radius-sm: 0.125rem;   /* 2px */
    --border-radius: 0.375rem;      /* 6px */
    --border-radius-md: 0.5rem;     /* 8px */
    --border-radius-lg: 0.75rem;    /* 12px */
    --border-radius-xl: 1rem;       /* 16px */
    --border-radius-full: 50%;

    /* === SHADOWS === */
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
    --shadow-base: 0 1px 3px rgba(0, 0, 0, 0.1), 0 1px 2px rgba(0, 0, 0, 0.06);
    --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.1);
    --shadow-xl: 0 20px 25px rgba(0, 0, 0, 0.15);
    --box-shadow: var(--shadow-base);

    /* === TRANSITIONS === */
    --transition-fast: all 0.1s ease-in-out;
    --transition: all 0.15s ease-in-out;
    --transition-slow: all 0.3s ease-in-out;

    /* === Z-INDEX === */
    --z-dropdown: 1000;
    --z-sticky: 1020;
    --z-fixed: 1030;
    --z-modal-backdrop: 1040;
    --z-modal: 1050;
    --z-popover: 1060;
    --z-tooltip: 1070;
    --z-toast: 1080;

    /* === COMPONENT SIZES === */
    --input-height: 2.5rem;    /* 40px */
    --input-height-sm: 2rem;   /* 32px */
    --input-height-lg: 3rem;   /* 48px */

    --button-height: var(--input-height);
    --button-height-sm: var(--input-height-sm);
    --button-height-lg: var(--input-height-lg);

    /* === LEGACY COMPATIBILITY === */
    /* Keep old variable names for backward compatibility */
    --primary-color: var(--brand-primary);
    --secondary-color: var(--brand-secondary);
    --success-color: var(--brand-accent);
    --danger-color: var(--brand-danger);
    --warning-color: var(--brand-warning);
    --info-color: var(--brand-info);
    --light-color: var(--color-light);
    --dark-color: var(--color-dark);

    --font-size-base: var(--font-size-base);
    --line-height-base: var(--line-height-base);
    --text-color: var(--color-text-primary);
    --border-color: var(--color-border);
    --background-color: var(--color-background);
}

* {
    box-sizing: border-box;
}

body {
    font-family: var(--font-family);
    font-size: var(--font-size-base);
    line-height: var(--line-height-base);
    color: var(--dark-color);
    background-color: #ffffff;
    margin: 0;
    padding: 0;
}

/* ===== LAYOUT COMPONENTS ===== */

/* Navigation */
.navbar-brand {
    font-weight: 600;
    font-size: 1.5rem;
}

.navbar-nav .nav-link {
    font-weight: 500;
    transition: var(--transition);
}

.navbar-nav .nav-link:hover {
    color: rgba(255, 255, 255, 0.8) !important;
}

/* Main Content Area */
.main-content {
    min-height: calc(100vh - 120px);
    padding: 2rem 0;
}

/* Cards */
.card {
    border: 1px solid rgba(0, 0, 0, 0.125);
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    margin-bottom: 1.5rem;
}

.card-header {
    background-color: var(--light-color);
    border-bottom: 1px solid rgba(0, 0, 0, 0.125);
    font-weight: 600;
}

/* ===== UTILITY CLASSES ===== */

/* Spacing */
.mb-4 { margin-bottom: 1.5rem !important; }
.mt-4 { margin-top: 1.5rem !important; }
.py-3 { padding-top: 1rem !important; padding-bottom: 1rem !important; }

/* Text */
.text-primary { color: var(--primary-color) !important; }
.text-success { color: var(--success-color) !important; }
.text-danger { color: var(--danger-color) !important; }
.text-warning { color: var(--warning-color) !important; }

/* Display */
.d-none { display: none !important; }
.d-block { display: block !important; }
.d-flex { display: flex !important; }

/* ===== RESPONSIVE DESIGN ===== */
@media (max-width: 768px) {
    .main-content {
        padding: 1rem 0;
    }

    .navbar-brand {
        font-size: 1.25rem;
    }

    .card {
        margin-bottom: 1rem;
    }
}

/* ===== MODERN UI COMPONENTS ===== */

/* Modern Cards */
.modern-card {
    background: white;
    border: 1px solid var(--color-border-light);
    border-radius: var(--border-radius-xl);
    box-shadow: var(--shadow-base);
    overflow: hidden;
    transition: var(--transition);
}

.modern-card:hover {
    box-shadow: var(--shadow-md);
}

.modern-card-header {
    /* WCAG AAA compliant gradient - Contrast ratio: 8.59:1 */
    background: linear-gradient(135deg, #0056b3 0%, #004494 100%);
    color: #ffffff;
    padding: var(--space-6);
    position: relative;
    overflow: hidden;
    /* Enhance text readability with subtle shadow */
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}


.modern-card-header h1,
.modern-card-header h2,
.modern-card-header h3,
.modern-card-header h4,
.modern-card-header h5,
.modern-card-header h6 {
    margin: 0;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
    position: relative;
    z-index: 0;
}

.modern-card-body {
    padding: var(--space-8);
}

/* Modern Form Controls */
.form-control, .form-select {
    border-radius: var(--border-radius-md);
    border: 2px solid var(--color-border);
    background-color: var(--color-background);
    color: var(--color-text-primary);
    font-size: var(--font-size-base);
    padding: var(--space-4) var(--space-3);
    height: calc(3.5rem + 2px);
    transition: var(--transition);
}

.form-control:focus, .form-select:focus {
    border-color: var(--brand-primary);
    box-shadow: 0 0 0 0.2rem rgba(13, 110, 253, 0.25),
                0 0 20px rgba(79, 195, 247, 0.3);
    background-color: var(--color-background);
    transform: translateY(-1px);
}

.form-control::placeholder {
    color: var(--color-text-muted);
    opacity: 0.7;
}

.form-floating label {
    color: var(--color-text-secondary);
    font-weight: var(--font-weight-medium);
    font-size: var(--font-size-sm);
}

/* Modern Buttons */
.btn-primary {
    background: linear-gradient(135deg, var(--brand-primary) 0%, #29b6f6 100%);
    border: none;
    border-radius: var(--border-radius-lg);
    padding: var(--space-3) var(--space-6);
    font-weight: var(--font-weight-semibold);
    font-size: var(--font-size-base);
    letter-spacing: 0.5px;
    transition: var(--transition);
    color: white;
    position: relative;
    overflow: hidden;
}

.btn-success{
    font-size: var(--font-size-base);
}


.btn-primary:hover {
    box-shadow: var(--shadow-md);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-primary:focus {
    box-shadow: 0 0 0 0.2rem rgba(13, 110, 253, 0.25);
}

/* Modern Navigation */
.modern-navbar {
    z-index: 1;
    background: rgba(255, 255, 255, 0.95) !important;
    backdrop-filter: blur(15px);
    border: none;
    box-shadow: var(--shadow-lg);
    border-radius: 0 0 var(--border-radius-xl) var(--border-radius-xl);
    transition: var(--transition);
}

.modern-navbar .navbar-brand {
    font-weight: var(--font-weight-bold);
    color: var(--brand-primary) !important;
    font-size: var(--font-size-xl);
}

.modern-navbar .nav-link {
    color: var(--color-text-primary) !important;
    font-weight: var(--font-weight-medium);
    padding: var(--space-3) var(--space-4) !important;
    border-radius: var(--border-radius-md);
    transition: var(--transition);
    margin: 0 var(--space-1);
}

.modern-navbar .nav-link:hover {
    background: rgba(0, 123, 255, 0.1);
    color: var(--brand-primary) !important;
}

/* Modern Tables */
.modern-table {
    margin: 0;
}

.modern-table thead th {
    background: linear-gradient(135deg, var(--color-gray-800) 0%, var(--color-gray-700) 100%);
    color: var(--color-text-inverse);
    border: none;
    padding: var(--space-4);
    font-weight: var(--font-weight-semibold);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-size: var(--font-size-sm);
}

.modern-table tbody tr {
    transition: var(--transition);
    border-bottom: 1px solid var(--color-border-light);
}

.modern-table tbody tr:hover {
    background-color: rgba(0, 123, 255, 0.05);
}

.modern-table tbody td {
    padding: var(--space-4);
    vertical-align: middle;
    font-weight: var(--font-weight-medium);
}

/* Modern Animations */
@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes shimmer {
    0% {
        transform: translateX(-100%) translateY(-100%) rotate(45deg);
    }
    100% {
        transform: translateX(100%) translateY(100%) rotate(45deg);
    }
}

/* ===== THEME SUPPORT ===== */
/* ===== ACCESSIBILITY ===== */

@media (prefers-reduced-motion: reduce) {
    .modern-card,
    .btn-primary,
    .form-control,
    .form-select,
    .modern-navbar .nav-link,
    .modern-table tbody tr {
        animation: none;
        transition: none;
    }

    .modern-card-header::before {
        animation: none;
    }
}

@media (prefers-contrast: high) {
    .modern-card {
        border: 2px solid var(--color-text-primary);
    }

    .form-control,
    .form-select {
        border-width: 2px;
    }

    .btn-primary {
        border: 2px solid var(--color-text-inverse);
    }
}

/* ===== LEGACY COMPATIBILITY ===== */

/* Old container class compatibility */
#contenitore {
    /* This class is being phased out - use Bootstrap container classes */
}

/* Old menu compatibility */
.menuPrincipale {
    /* This class is being phased out - use Bootstrap navbar */
}

/* ===== COMMON PAGE STYLES (SHARED ACROSS ALL PAGES) ===== */

/* Page Layout */
.page-dashboard {
    min-height: 100vh;
    background: white;
    position: relative;
}

/* Logout Button - Common Navigation Element */
.logout-btn {
    background: var(--color-danger);
    border: none;
    border-radius: var(--border-radius-lg);
    padding: var(--space-2) var(--space-4);
    color: white !important;
    font-weight: var(--font-weight-medium);
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: var(--space-2);
    text-decoration: none;
}

.logout-btn:hover {
    box-shadow: var(--shadow-md);
    color: white !important;
    transform: translateY(-1px);
}

/* Enhanced Modern Card Header with Gradient */
.modern-card-header {
    background: var(--brand-primary) !important;
    color: var(--color-text-inverse);
    padding: var(--space-6);
    position: relative;
    overflow: hidden;
}

/* Table Responsive - Enhanced with Hover */
.table-responsive {
    border-radius: var(--border-radius-lg);
    overflow: hidden;
    transition: var(--transition);
}

.table-striped tbody tr {
    transition: all 0.2s ease-in-out;
}

.table-striped tbody tr:hover {
    background: linear-gradient(135deg, rgba(0, 123, 255, 0.08) 0%, rgba(41, 182, 246, 0.08) 100%);
    transform: scale(1.001);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.table {
    margin-bottom: 0;
    transition: var(--transition);
}

.table thead {
    position: sticky;
    top: 0;
    z-index: 10;
}

.table th {
    font-weight: var(--font-weight-semibold);
    text-transform: uppercase;
    font-size: 0.85rem;
    letter-spacing: 0.5px;
}

.table td {
    vertical-align: middle;
    font-size: 0.9rem;
}

/* Footer - Common Across Pages */
.footer {
    background: rgba(0, 0, 0, 0.9);
    color: var(--color-text-inverse);
    text-align: center;
    padding: var(--space-6);
    margin-top: var(--space-12);
    font-size: var(--font-size-sm);
    backdrop-filter: blur(10px);
    border-radius: var(--border-radius-xl) var(--border-radius-xl) 0 0;
    transition: var(--transition);
}

.footer a {
    color: var(--color-text-inverse);
    text-decoration: none;
    transition: var(--transition);
}

.footer a:hover {
    color: var(--brand-primary);
    text-decoration: underline;
}

/* Container Fluid with Transition */
.container-fluid {
    transition: var(--transition);
}

/* Enhanced Modern Card Hover Effects */
.modern-card {
    transition: var(--transition);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.modern-card:hover {
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
}

/* ===== COMMON RESPONSIVE ENHANCEMENTS ===== */

@media (max-width: 992px) {
    .table {
        font-size: 0.85rem;
    }

    .table th,
    .table td {
        padding: 0.5rem;
    }

    .modern-card-body {
        padding: var(--space-6);
    }
}

@media (max-width: 768px) {
    .container-fluid {
        padding: 0 var(--space-2);
    }

    .modern-card {
        margin-bottom: var(--space-4);
        border-radius: var(--border-radius-md);
    }

    .modern-card-header h3 {
        font-size: 1.1rem;
    }

    .table {
        font-size: 0.8rem;
    }

    .table th,
    .table td {
        padding: 0.4rem;
    }

    .footer {
        font-size: 0.8rem;
        padding: var(--space-4);
    }
}

@media (max-width: 576px) {
    .modern-card-header h3 {
        font-size: 1rem;
    }

    .table {
        font-size: 0.75rem;
    }

    .table th,
    .table td {
        padding: 0.3rem 0.2rem;
        font-size: 0.7rem;
    }
}

/* === FORM VALIDATION STYLES - WCAG 3.3.1 Compliant === */

/* Error container highlight */
.has-error {
    background-color: rgba(220, 53, 69, 0.05);
    transition: all 0.2s ease;
}

.has-error:focus-within {
    background-color: rgba(220, 53, 69, 0.1);
}

/* Error message styling */
.error-message {
    color: #dc3545;
    font-size: 0.875rem;
    margin-top: 0.5rem;
    padding: 0.5rem;
    background-color: #f8d7da;
    border-left: 3px solid #dc3545;
    border-radius: 0.25rem;
    display: flex;
    align-items: center;
}

.error-message i {
    flex-shrink: 0;
}

/* Bootstrap invalid feedback enhancement */
.invalid-feedback {
    color: #dc3545;
    font-size: 0.875rem;
    margin-top: 0.25rem;
}

.is-invalid {
    border-color: #dc3545 !important;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12' width='12' height='12' fill='none' stroke='%23dc3545'%3e%3ccircle cx='6' cy='6' r='4.5'/%3e%3cpath stroke-linejoin='round' d='M5.8 3.6h.4L6 6.5z'/%3e%3ccircle cx='6' cy='8.2' r='.6' fill='%23dc3545' stroke='none'/%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right calc(0.375em + 0.1875rem) center;
    background-size: calc(0.75em + 0.375rem) calc(0.75em + 0.375rem);
    padding-right: calc(1.5em + 0.75rem);
}

.is-invalid:focus {
    border-color: #dc3545;
    box-shadow: 0 0 0 0.25rem rgba(220, 53, 69, 0.25);
}

/* Visually hidden utility for screen readers */
.visually-hidden {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    white-space: nowrap !important;
    border: 0 !important;
}

/* Animation for error appearance */
.invalid-feedback,
.error-message {
    animation: slideDownFade 0.3s ease-out;
}

@keyframes slideDownFade {
    from {
        opacity: 0;
        transform: translateY(-5px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Respect reduced motion */
@media (prefers-reduced-motion: reduce) {
    .invalid-feedback,
    .error-message {
        animation: none;
    }
}

/* === FOCUS MANAGEMENT - WCAG 2.4.3 Focus Order === */

/* Elementi con tabindex="-1" (programmatically focusable) */
[tabindex="-1"]:focus {
    outline: 3px solid #0056b3;
    outline-offset: 2px;
    border-radius: 4px;
    /* Visibile ma non invasivo */
}

/* Remove outline dopo click (solo keyboard focus) */
[tabindex="-1"]:focus:not(:focus-visible) {
    outline: none;
}

/* Modern focus-visible support (solo keyboard) */
[tabindex="-1"]:focus-visible {
    outline: 3px solid #0056b3;
    outline-offset: 2px;
    border-radius: 4px;
}

/* Smooth scroll behavior per accessibility */
html {
    scroll-behavior: smooth;
}

/* Disable smooth scroll se utente preferisce ridotto movimento */
@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }

    * {
        scroll-behavior: auto !important;
    }
}

/* === EMPTY STATE COMPONENTS - Task #7 === */

.empty-state-container {
    max-width: 600px;
    margin: 0 auto;
    padding: 2rem 1rem;
}

.empty-state-icon {
    animation: float 3s ease-in-out infinite;
}

@keyframes float {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-10px);
    }
}

/* Respect reduced motion */
@media (prefers-reduced-motion: reduce) {
    .empty-state-icon {
        animation: none;
    }
}

.empty-state-icon i {
    opacity: 0.4;
    filter: drop-shadow(0 4px 8px rgba(0,0,0,0.1));
}

.empty-state-actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

.empty-state-help summary {
    font-weight: 600;
    padding: 0.5rem;
    border-radius: 0.25rem;
    transition: background-color 0.2s;
    cursor: pointer;
}

.empty-state-help summary:hover {
    background-color: #f8f9fa;
}

.empty-state-help[open] summary {
    margin-bottom: 1rem;
}

/* Mobile responsive */
@media (max-width: 576px) {
    .empty-state-container {
        padding: 1.5rem 0.5rem;
    }

    .empty-state-icon i {
        font-size: 3rem !important;
    }

    .empty-state-actions {
        flex-direction: column;
        width: 100%;
    }

    .empty-state-actions .btn {
        width: 100%;
    }
}

/* === SKELETON LOADER & LOADING STATES - Task #8 === */

.skeleton-loader {
    animation: skeleton-fade-in 0.3s ease-in-out;
}

@keyframes skeleton-fade-in {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.skeleton-text {
    background-color: #e9ecef;
    border-radius: 0.25rem;
    height: 16px;
}

.skeleton-pulse {
    background: linear-gradient(
        90deg,
        #f0f0f0 0%,
        #e0e0e0 50%,
        #f0f0f0 100%
    );
    background-size: 200% 100%;
    animation: skeleton-loading 1.5s ease-in-out infinite;
}

@keyframes skeleton-loading {
    0% {
        background-position: 200% 0;
    }
    100% {
        background-position: -200% 0;
    }
}

/* Loading button state */
.btn-loading {
    position: relative;
}

/* Respect prefers-reduced-motion */
@media (prefers-reduced-motion: reduce) {
    .skeleton-pulse {
        animation: none;
        background: #e9ecef;
    }

    .skeleton-loader {
        animation: none;
    }
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
    .skeleton-text {
        background-color: #343a40;
    }

    .skeleton-pulse {
        background: linear-gradient(
            90deg,
            #495057 0%,
            #343a40 50%,
            #495057 100%
        );
    }
}

/* ==========================================================================
   Language Switcher Styles
   ========================================================================== */

/* Language flag sizing */
.language-flag-small {
    width: 20px;
    height: 15px;
    object-fit: cover;
    border-radius: 2px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

/* Language dropdown button */
.language-switcher-btn {
    display: flex;
    align-items: center;
    padding: 0.375rem 0.75rem;
    transition: all 0.2s ease;
    text-decoration: none;
    color: inherit;
}

.language-switcher-btn:hover {
    background-color: rgba(255, 255, 255, 0.1);
    border-radius: 0.25rem;
}

.language-switcher-btn:focus {
    outline: 2px solid var(--color-primary);
    outline-offset: 2px;
}

.language-switcher-label {
    font-weight: 500;
    font-size: 0.875rem;
    text-transform: uppercase;
}

/* Language dropdown menu */
.language-switcher-dropdown .dropdown-menu {
    min-width: 150px;
    border-radius: 0.375rem;
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
    border: 1px solid rgba(0, 0, 0, 0.1);
}

/* Language option items */
.language-option {
    display: flex;
    align-items: center;
    padding: 0.5rem 1rem;
    transition: all 0.2s ease;
    cursor: pointer;
    text-decoration: none;
    color: inherit;
}

.language-option:hover {
    background-color: #f8f9fa;
    transform: translateX(2px);
}

.language-option:active,
.language-option.active {
    background-color: #e9ecef;
    font-weight: 600;
}

.language-option:focus {
    outline: 2px solid var(--color-primary);
    outline-offset: -2px;
}

/* Loading state */
.language-switcher-btn.disabled {
    pointer-events: none;
    opacity: 0.6 !important;
}

/* Animation for language change */
@keyframes languageChange {
    0% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.5; transform: scale(0.95); }
    100% { opacity: 1; transform: scale(1); }
}

.language-changing .language-switcher-flag {
    animation: languageChange 0.5s ease;
}

/* Mobile responsive */
@media (max-width: 768px) {
    .language-switcher-dropdown {
        margin-right: 0.5rem;
    }

    .language-switcher-label {
        display: none; /* Hide label text on mobile, keep only flag */
    }

    .language-flag-small {
        width: 24px;
        height: 18px;
    }
}

/* Print - hide language switcher */
@media print {
    .language-switcher-dropdown {
        display: none !important;
    }
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
    .language-switcher-btn:hover {
        background-color: rgba(0, 0, 0, 0.2);
    }

    .language-option:hover {
        background-color: #495057;
    }

    .language-option:active,
    .language-option.active {
        background-color: #343a40;
    }
}