* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    /* Official Site Colors - Black/Silver/Blue Theme */
    --bg-black: #000000;
    --bg-dark: #0d0d0d;
    --bg-card: #1a1a1a;
    --silver: #c0c0c0;
    --silver-light: #e8e8e8;
    --text-primary: #ffffff;
    --text-secondary: #b0b0b0;
    --accent-blue: #4a90e2;
    --accent-blue-hover: #357abd;
    --border-silver: #3a3a3a;
    --success-color: #27ae60;
    --shadow-subtle: 0 2px 8px rgba(0, 0, 0, 0.3);
    --shadow-medium: 0 4px 12px rgba(0, 0, 0, 0.4);
}

body {
    font-family: 'Rajdhani', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: #000000 url('/static/images/space-background.jpg') center/cover fixed no-repeat;
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
    position: relative;
}

body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    z-index: -1;
    pointer-events: none;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
}

header {
    text-align: center;
    padding: 40px 20px;
    background: rgba(13, 13, 13, 0.98);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-bottom: 2px solid var(--border-silver);
    border-radius: 0;
    margin-bottom: 30px;
    box-shadow: var(--shadow-subtle);
}

.header-content {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 30px;
    flex-wrap: wrap;
}

.logo-link {
    display: inline-block;
    cursor: pointer;
    transition: opacity 0.2s;
    text-decoration: none;
}

.logo-link:hover {
    opacity: 0.8;
}

.header-logo {
    max-width: 150px;
    height: auto;
}

.header-text {
    text-align: left;
}

.header-text h1 {
    font-family: 'Orbitron', sans-serif;
    font-size: 2rem;
    color: var(--silver-light);
    margin-bottom: 5px;
    text-shadow: none;
    font-weight: 700;
    letter-spacing: 1px;
}

.header-text .subtitle {
    color: var(--text-secondary);
    font-size: 1.1rem;
}

.section-separator {
    width: 100%;
    height: 33px;
    margin: 20px 0;
    background: url('/static/images/separator.svg') center/contain no-repeat;
    opacity: 0.6;
    position: relative;
    z-index: 0;
}

.stats-section {
    display: none; /* Hidden as requested */
    display: flex;
    gap: 20px;
    justify-content: center;
    margin-bottom: 30px;
    flex-wrap: wrap;
}

.stat-card {
    background: var(--card-bg);
    padding: 20px 40px;
    border-radius: 12px;
    box-shadow: var(--shadow);
    text-align: center;
    transition: transform 0.2s;
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-hover);
}

.stat-value {
    display: block;
    font-size: 2rem;
    font-weight: bold;
    color: var(--secondary-color);
}

.stat-label {
    display: block;
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-top: 5px;
}

.search-section {
    background: rgba(26, 26, 26, 0.95);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    padding: 30px;
    border-radius: 8px;
    border: 1px solid var(--border-silver);
    box-shadow: var(--shadow-subtle);
    margin-bottom: 30px;
    position: relative;
    z-index: 100;
}

.search-controls {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
}

.search-field {
    position: relative;
    flex: 1;
    min-width: 250px;
    z-index: 99999;
}

.search-input {
    width: 100%;
    padding: 12px 20px;
    border: 1px solid var(--border-silver);
    border-radius: 6px;
    font-size: 1rem;
    background: var(--bg-dark);
    color: var(--text-primary);
    transition: all 0.3s;
}

.search-input:focus {
    outline: none;
    border-color: var(--accent-blue);
    box-shadow: 0 0 0 2px rgba(74, 144, 226, 0.2);
}

.search-input::placeholder {
    color: var(--text-secondary);
}

/* Autocomplete Dropdown */
.autocomplete-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: rgba(13, 13, 13, 0.98);
    border: 1px solid var(--border-silver);
    border-top: none;
    border-radius: 0 0 8px 8px;
    max-height: 250px;
    overflow-y: auto;
    z-index: 99998;
    display: none;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
}

.autocomplete-dropdown.show {
    display: block;
}

.autocomplete-item {
    padding: 8px 12px;
    cursor: pointer;
    color: var(--text-primary);
    border-bottom: 1px solid rgba(192, 192, 192, 0.1);
    transition: background-color 0.2s;
    display: flex;
    align-items: center;
    gap: 12px;
}

.autocomplete-item:hover {
    background: rgba(64, 156, 255, 0.2);
}

.autocomplete-item:last-child {
    border-bottom: none;
}

.autocomplete-thumb {
    width: 50px;
    height: auto;
    border-radius: 4px;
    flex-shrink: 0;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.autocomplete-text {
    flex: 1;
    font-weight: 500;
    color: var(--silver-light);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.filter-select {
    padding: 12px 20px;
    border: 1px solid var(--border-silver);
    border-radius: 6px;
    font-size: 1rem;
    background: var(--bg-dark);
    color: var(--text-primary);
    cursor: pointer;
    transition: all 0.3s;
}

.filter-select:focus {
    outline: none;
    border-color: var(--accent-blue);
    box-shadow: 0 0 0 2px rgba(74, 144, 226, 0.2);
}

.btn-primary {
    padding: 12px 30px;
    background: var(--accent-blue);
    color: #ffffff;
    border: none;
    border-radius: 6px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-primary:hover {
    background: var(--accent-blue-hover);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(74, 144, 226, 0.3);
}

.loading {
    display: none;
    text-align: center;
    padding: 40px;
}

.spinner {
    border: 4px solid rgba(255, 255, 255, 0.1);
    border-top: 4px solid var(--accent-blue);
    border-radius: 50%;
    width: 50px;
    height: 50px;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.content-sections {
    display: grid;
    grid-template-columns: 1fr;
    gap: 30px;
}

.cards-list-section,
.replacement-section {
    background: rgba(26, 26, 26, 0.95);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    padding: 30px;
    border-radius: 12px;
    border: 1px solid var(--border-silver);
    box-shadow: var(--shadow-medium);
    position: relative;
    z-index: 1;
}

.cards-list-section h2,
.replacement-section h2 {
    margin-bottom: 20px;
    color: var(--silver-light);
}

.cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
    align-items: stretch;
}

/* Empty state styling */
.empty-state {
    grid-column: 1 / -1;  /* Span full grid width */
    text-align: center;
    padding: 60px 20px;
    color: var(--text-light);
    font-size: 1.1rem;
    width: 100%;  /* Ensure full width */
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.empty-state p {
    margin: 0;
    max-width: 600px;  /* Constrain text width for readability */
}

.empty-state p:first-child {
    font-size: 2rem;
    margin-bottom: 20px;
}

.empty-state p:last-child {
    color: #95a5a6;
    font-size: 0.95rem;
}

/* Hide separator when the following replacement section is hidden */
.section-separator:has(+ .replacement-section[style*="display: none"]),
.section-separator:has(+ .replacement-section:not([style*="display: block"])) {
    display: none;
}

/* Fallback for browsers without :has() support */
.section-separator.hidden {
    display: none;
}

.card-item {
    background: #ffffff;
    border: 2px solid #d0d5dd;
    border-radius: 8px;
    padding: 15px;
    transition: all 0.3s;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    gap: 10px;
    height: 100%;
}

.card-item:hover {
    border-color: var(--accent-blue);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(74, 144, 226, 0.3);
}

.card-image-container {
    position: relative;
    margin-bottom: 10px;
}

.card-back-image-container {
    margin-top: 15px;
    position: relative;
    padding-top: 15px;
    border-top: 2px dashed rgba(192, 192, 192, 0.3);
}

.card-back-image-container::before {
    content: 'BACK';
    position: absolute;
    top: -10px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(13, 13, 13, 0.9);
    color: var(--silver-light);
    padding: 2px 12px;
    border-radius: 4px;
    font-size: 0.7rem;
    font-weight: bold;
    letter-spacing: 1px;
    z-index: 1;
}

.card-back-image {
    width: 100%;
    height: auto;
    border-radius: 8px;
    display: block;
}

.card-image {
    width: 100%;
    height: auto;
    border-radius: 8px;
    display: block;
}

.card-carousel {
    display: flex;
    align-items: center;
    justify-content: center;
    position: absolute;
    bottom: 10px;
    left: 0;
    right: 0;
    z-index: 10;
    opacity: 0;
    transition: opacity 0.3s;
    pointer-events: none;
}

.card-image-container:hover .card-carousel {
    opacity: 1;
    pointer-events: all;
}

.carousel-prev,
.carousel-next {
    background: rgba(0, 0, 0, 0.6);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.3);
    width: 24px;
    height: 24px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    position: absolute;
}

.carousel-prev {
    left: 10px;
}

.carousel-next {
    right: 10px;
}

.carousel-prev:hover,
.carousel-next:hover {
    background: var(--accent-blue);
    border-color: white;
    transform: scale(1.1);
}

.carousel-indicators {
    display: flex;
    gap: 6px;
    align-items: center;
    background: rgba(0, 0, 0, 0.6);
    padding: 4px 8px;
    border-radius: 12px;
}

.indicator {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.5);
    cursor: pointer;
    transition: all 0.2s;
    border: 1px solid rgba(255, 255, 255, 0.8);
}

.indicator.active {
    background: var(--accent-blue);
    border-color: white;
    width: 10px;
    height: 10px;
}

.card-name {
    font-weight: bold;
    font-size: 1.1rem;
    color: #2c3e50;
    margin-bottom: 8px;
}

.card-subtitle-inline {
    font-style: italic;
    color: #7f8c8d;
    font-weight: normal;
    font-size: 0.95em;
}

.card-subtitle {
    font-size: 0.9rem;
    color: #7f8c8d;
    font-style: italic;
    margin-bottom: 8px;
}

.card-aspects {
    display: flex;
    gap: 4px;
    flex-wrap: wrap;
    margin: 8px 0;
    font-size: 0.6rem;
}

.aspect-badge {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    padding: 3px 6px;
    border-radius: 12px;
    font-size: 0.6rem;
    font-weight: bold;
    text-transform: uppercase;
    color: white;
}

.aspect-icon {
    width: 16px;
    height: 16px;
    display: inline-block;
    vertical-align: middle;
}

.aspect-Aggression { background: #d32f2f; color: white; }
.aspect-Command { background: #388e3c; color: white; }
.aspect-Cunning { background: #fbc02d; color: #333; }
.aspect-Heroism { background: #ffffff; color: #333; border: 1px solid #ccc; }
.aspect-Vigilance { background: #1976d2; color: white; }
.aspect-Villainy { background: #000000; color: white; }

.card-text {
    font-size: 0.9rem;
    color: #e8e8e8;
    background: rgba(13, 13, 13, 0.9);
    padding: 10px;
    border-radius: 6px;
    border-left: 3px solid var(--accent-blue);
    margin-top: 10px;
    line-height: 1.4;
    flex: 1;
    overflow: auto;
}

.card-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-top: 8px;
    font-size: 0.68rem;
}

.badge {
    display: inline-block;
    padding: 3px 6px;
    background: #ecf0f1;
    color: #2c3e50;
    border-radius: 4px;
    font-size: 0.68rem;
    font-weight: 600;
}

.badge-cost { background: #3498db; color: white; }
.badge-stats { background: #e74c3c; color: white; }
.badge-set { background: #95a5a6; color: white; }

.card-traits {
    font-size: 0.68rem;
    color: #2c3e50;
    margin: 8px 0;
    padding: 6px 8px;
    background: #f8f9fa;
    border-radius: 4px;
}

.badge-rarity {
    font-weight: bold;
    text-transform: uppercase;
    font-size: 0.75rem;
}

.badge-common { background: #95a5a6; }
.badge-uncommon { background: #27ae60; }
.badge-rare { background: #3498db; }
.badge-legendary { background: #f39c12; }
.badge-special { background: #9b59b6; }

.pagination {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-top: 20px;
}

.pagination button {
    padding: 10px 20px;
    background: var(--accent-blue);
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
    transition: background 0.2s;
}

.pagination button:hover:not(:disabled) {
    background: var(--accent-blue-hover);
}

.pagination button:disabled {
    background: #95a5a6;
    cursor: not-allowed;
    opacity: 0.5;
}

.card-detail {
    background: #f8f9fa;
    border: 2px solid #d0d5dd;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 20px;
}

.card-detail .card-abilities {
    background: #ffffff;
    padding: 15px;
    border-radius: 6px;
    margin-top: 15px;
    white-space: pre-wrap;
    line-height: 1.6;
}

.original-card-section {
    margin-bottom: 30px;
}

.original-card-section h3,
.replacements-list h3 {
    color: var(--silver-light);
    background: rgba(0, 0, 0, 0.5);
    padding: 12px 20px;
    border-radius: 6px;
    margin-bottom: 15px;
    font-size: 1.2rem;
    border-left: 4px solid var(--accent-blue);
}

.replacements-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 20px;
    align-items: stretch;
}

.replacement-item {
    background: #ffffff;
    border: 2px solid #d0d5dd;
    border-radius: 8px;
    padding: 15px;
    transition: all 0.3s;
    display: flex;
    flex-direction: column;
    gap: 10px;
    position: relative;
    height: 100%;
}

.replacement-item:hover {
    border-color: var(--success-color);
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(39, 174, 96, 0.3);
}

.similarity-score {
    display: inline-block;
    padding: 6px 12px;
    background: linear-gradient(135deg, var(--success-color), #2ecc71);
    color: white;
    border-radius: 6px;
    font-weight: bold;
    font-size: 0.9rem;
    margin-bottom: 10px;
    text-align: center;
}

.similarity-score.medium {
    background: linear-gradient(135deg, #f39c12, #f1c40f);
}

.similarity-score.low {
    background: linear-gradient(135deg, #95a5a6, #bdc3c7);
}

.reasoning {
    background: #000000;
    color: #ffffff;
    padding: 10px;
    border-radius: 6px;
    margin-top: 10px;
    font-style: italic;
    border-left: 3px solid var(--accent-blue);
    font-size: 0.85rem;
    line-height: 1.4;
}

.btn-find-replacement {
    display: inline-block;
    margin-top: 10px;
    padding: 8px 20px;
    background: var(--accent-blue);
    color: #ffffff;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s;
}

.btn-find-replacement:hover {
    background: var(--accent-blue-hover);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(74, 144, 226, 0.3);
}

/* Original Card Compact Layout */
.original-card-compact {
    display: flex;
    gap: 20px;
    padding: 20px;
    background: #2a2a2a;
    border: 2px solid var(--accent-blue);
    border-radius: 8px;
    margin-bottom: 30px;
    box-shadow: 0 4px 12px rgba(74, 144, 226, 0.2);
}

.original-card-image {
    flex-shrink: 0;
    max-width: 300px;
    width: 100%;
    height: auto;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
}

.original-card-details {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.original-card-details h3 {
    margin: 0;
    color: var(--text-primary);
    font-size: 1.5rem;
}

.original-card-details .subtitle {
    font-style: italic;
    color: var(--text-secondary);
    margin-bottom: 5px;
}

.original-card-details .card-aspects {
    margin: 10px 0;
}

.original-card-details .card-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 10px 0;
}

.original-card-details .card-abilities {
    background: #1a1a1a;
    color: var(--text-primary);
    padding: 12px;
    border-radius: 6px;
    border-left: 4px solid var(--accent-blue);
    white-space: pre-wrap;
    line-height: 1.6;
}

.original-card-details .card-name,
.original-card-details .card-subtitle,
.original-card-details .card-text,
.original-card-details .card-traits {
    color: var(--text-primary);
}

/* Foil Card Effects */
.card-image-container.foil {
    position: relative;
}

.card-image.foil {
    position: relative;
    box-shadow: 0 0 25px rgba(80, 80, 80, 0.9),
                0 0 50px rgba(60, 60, 60, 0.7),
                0 0 75px rgba(40, 40, 40, 0.5);
    animation: glow-pulse 2s ease-in-out infinite;
    filter: brightness(1.1);
}

.card-image.foil::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        45deg,
        transparent 30%,
        rgba(255, 255, 255, 0.5) 50%,
        transparent 70%
    );
    animation: shimmer 3s infinite;
    pointer-events: none;
    border-radius: 8px;
}

@keyframes shimmer {
    0% { transform: translateX(-100%) skewX(-15deg); }
    100% { transform: translateX(100%) skewX(-15deg); }
}

@keyframes glow-pulse {
    0%, 100% { 
        box-shadow: 0 0 25px rgba(80, 80, 80, 0.9),
                    0 0 50px rgba(60, 60, 60, 0.7),
                    0 0 75px rgba(40, 40, 40, 0.5);
    }
    50% { 
        box-shadow: 0 0 35px rgba(80, 80, 80, 1),
                    0 0 70px rgba(60, 60, 60, 0.9),
                    0 0 100px rgba(40, 40, 40, 0.7);
    }
}

.foil-badge {
    position: absolute;
    top: 5px;
    right: 5px;
    background: linear-gradient(135deg, #c0c0c0, #e8e8e8);
    color: #2c3e50;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.7rem;
    font-weight: bold;
    box-shadow: 0 2px 8px rgba(192, 192, 192, 0.5);
    z-index: 5;
}

/* Legal Footer */
.legal-footer {
    background: rgba(13, 13, 13, 0.98);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-top: 2px solid var(--border-silver);
    margin-top: 60px;
    padding: 30px 20px;
    font-size: 0.85rem;
    color: var(--text-secondary);
    box-shadow: var(--shadow-subtle);
    text-align: center;
    line-height: 1.8;
}

.legal-footer p {
    margin-bottom: 15px;
}

.legal-footer strong {
    color: var(--silver-light);
}

.legal-footer a {
    color: var(--accent-blue);
    text-decoration: none;
    transition: color 0.2s;
}

.legal-footer a:hover {
    color: var(--accent-blue-hover);
    text-decoration: underline;
}

.footer-content {
    max-width: 1200px;
    margin: 0 auto;
    line-height: 1.8;
}

.footer-content p {
    margin-bottom: 12px;
}

.footer-content strong {
    color: var(--accent-blue);
}

.footer-credit {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid rgba(74, 144, 226, 0.3);
    text-align: center;
    font-size: 0.75rem;
}

@media (max-width: 768px) {
    .search-controls {
        flex-direction: column;
    }
    
    .search-input,
    .filter-select {
        width: 100%;
    }
    
    .cards-grid,
    .replacements-grid {
        grid-template-columns: 1fr;
    }
    
    /* Stack original card on mobile */
    .original-card-compact {
        flex-direction: column;
    }
    
    .original-card-image {
        width: 100%;
        max-width: 300px;
        margin: 0 auto;
        display: block;
    }
}

/* Why button for on-demand LLM explanations */
.btn-why {
    background: var(--accent-blue);
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.9rem;
    margin-top: 10px;
    width: 100%;
    transition: all 0.3s ease;
    font-family: 'Rajdhani', sans-serif;
    font-weight: 600;
}

.btn-why:hover {
    background: var(--accent-blue-hover);
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(74, 144, 226, 0.3);
}

.btn-why:disabled {
    background: #95a5a6;
    cursor: not-allowed;
    transform: none;
    opacity: 0.6;  /* Visual feedback when disabled */
}

.btn-why-loading {
    font-style: italic;
    color: var(--silver-light);
}

/* Horizontal card layout for Leaders and Bases */
.original-card-compact-horizontal {
    display: flex;
    gap: 20px;
    background: rgba(26, 26, 26, 0.95);
    padding: 20px;
    border-radius: 8px;
    border: 2px solid var(--accent-blue);
    margin-bottom: 30px;
    align-items: flex-start;
}

.card-image-horizontal {
    min-width: 400px;
    max-width: 400px;
    flex-shrink: 0;
}

.original-card-image.card-image-horizontal {
    width: 100%;
    height: auto;
    object-fit: contain;
}

/* Fix abilities title alignment in original card section */
.original-card-details .card-text {
    background: rgba(13, 13, 13, 0.9);
    padding: 10px;
    border-radius: 6px;
    border-left: 3px solid var(--accent-blue);
    margin-top: 10px;
    color: #e8e8e8;
    text-align: left;
}

.original-card-details .card-text strong {
    display: block;
    margin-bottom: 5px;
    margin-left: 0;
    text-align: left;
}

/* Lightsaber loading animation */
.lightsaber-loader {
    display: inline-block;
    position: relative;
    width: 60px;
    height: 20px;
    vertical-align: middle;
}

.lightsaber {
    position: absolute;
    width: 100%;
    height: 100%;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
}

.lightsaber-blade {
    position: absolute;
    left: 0;
    top: 50%;
    height: 3px;
    background: linear-gradient(90deg, #4a90e2, #357abd, #4a90e2);
    box-shadow: 0 0 10px #4a90e2, 0 0 20px #4a90e2, 0 0 30px #357abd;
    transform: translateY(-50%);
    animation: lightsaber-extend 1.5s ease-in-out infinite;
    border-radius: 2px;
}

@keyframes lightsaber-extend {
    0%, 100% {
        width: 0%;
        opacity: 0;
    }
    15% {
        opacity: 1;
    }
    50% {
        width: 100%;
        opacity: 1;
    }
    85% {
        opacity: 1;
    }
}

/* Blade tip glow */
.lightsaber-blade::after {
    content: '';
    position: absolute;
    right: 0;
    top: 50%;
    width: 6px;
    height: 6px;
    background: white;
    border-radius: 50%;
    transform: translate(50%, -50%);
    box-shadow: 0 0 10px white, 0 0 20px #4a90e2;
    opacity: 0;
    animation: blade-tip 1.5s ease-in-out infinite;
}

@keyframes blade-tip {
    0%, 15%, 85%, 100% {
        opacity: 0;
    }
    20%, 80% {
        opacity: 1;
    }
}

/* Language selector in header */
.header-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    width: 100%;
}

.header-text {
    flex: 1;
}

.language-selector {
    display: flex;
    gap: 8px;
    align-items: center;
}

.lang-flag {
    display: block;
    width: 32px;
    height: 24px;
    border: 2px solid var(--border-silver);
    border-radius: 4px;
    overflow: hidden;
    transition: all 0.3s ease;
    opacity: 0.6;
}

.lang-flag:hover {
    opacity: 1;
    border-color: var(--accent-blue);
    transform: scale(1.1);
}

.lang-flag.active {
    opacity: 1;
    border-color: var(--accent-blue);
    box-shadow: 0 0 8px var(--accent-blue);
}

.lang-flag img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
