/* Gmarket Sans Font Import - Fixed */

@font-face {
    font-family: 'GmarketSans';
    font-weight: 300;
    font-style: normal;
    src: url('https://fastly.jsdelivr.net/gh/projectnoonnu/noonfonts_2001@1.1/GmarketSansLight.woff') format('woff');
}

@font-face {
    font-family: 'GmarketSans';
    font-weight: 500;
    font-style: normal;
    src: url('https://fastly.jsdelivr.net/gh/projectnoonnu/noonfonts_2001@1.1/GmarketSansMedium.woff') format('woff');
}

@font-face {
    font-family: 'GmarketSans';
    font-weight: 700;
    font-style: normal;
    src: url('https://fastly.jsdelivr.net/gh/projectnoonnu/noonfonts_2001@1.1/GmarketSansBold.woff') format('woff');
}

/* CSS Variables */
:root {
    /* Colors */
    --primary-color: #2563eb;
    --secondary-color: #10b981;
    --danger-color: #ef4444;
    --warning-color: #f59e0b;
    --text-primary: #1f2937;
    --text-secondary: #6b7280;
    --bg-primary: #ffffff;
    --bg-secondary: #f3f4f6;
    --border-color: #e5e7eb;
    
    /* Category Colors */
    --repair-color: #f59e0b;
    --repair-bg: #fef3c7;
    --repair-border: #fcd34d;
    --safety-color: #ef4444;
    --safety-bg: #fee2e2;
    --safety-border: #fca5a5;
    --thanks-color: #10b981;
    --thanks-bg: #d1fae5;
    --thanks-border: #6ee7b7;
    --likes-color: #ec4899;
    --likes-bg: #fce7f3;
    --likes-border: #f9a8d4;
    
    /* Spacing */
    --spacing-xs: 0.25rem;
    --spacing-sm: 0.5rem;
    --spacing-md: 1rem;
    --spacing-lg: 1.5rem;
    --spacing-xl: 2rem;
    --spacing-2xl: 3rem;
    
    /* Layout */
    --border-radius: 0.5rem;
    --max-width: 1200px;
    --breakpoint-mobile: 768px;
    
    /* Shadows */
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    
    /* Touch Targets */
    --min-touch-target: 44px;
}

/* Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'GmarketSans', -apple-system, BlinkMacSystemFont, "Segoe UI", "Malgun Gothic", "Apple SD Gothic Neo", sans-serif;
    font-weight: 300;
    line-height: 1.6;
    color: var(--text-primary);
    background-color: white;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    min-height: 100vh;
    overflow-x: hidden;
    transition: background 0.6s ease;
}

/* Improve text rendering */
h1, h2, h3, h4, h5, h6 {
    font-family: 'GmarketSans', sans-serif;
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: var(--spacing-md);
}

p {
    font-family: 'GmarketSans', sans-serif;
    font-weight: 300;
    margin-bottom: var(--spacing-md);
}

p:last-child {
    margin-bottom: 0;
}

.container {
    max-width: 480px; /* Mobile screen width for consistent layout across devices */
    margin: 0 auto;
    padding: var(--spacing-md);
    width: 100%;
}

/* Hero Section */
.hero {
    text-align: center;
    padding: var(--spacing-md);
    margin-bottom: var(--spacing-xl);
}

/* Only apply background to non-full-screen hero */
.hero:not(.full-screen-section) {
    background-color: var(--bg-primary);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-md);
}

.hero h1 {
    font-size: 2.2rem;
    line-height: 1.4;
    margin-bottom: var(--spacing-md);
    color: white;
}

.warning {
    font-family: 'GmarketSans', sans-serif;
    color: var(--danger-color);
    font-weight: 700;
    margin: var(--spacing-md) 0;
}

/* Hero Animation */
.hero-animation {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 120px;
    margin: var(--spacing-lg) 0;
    position: relative;
}

.hero-animation .license-plate {
    background: white;
    border: 3px solid #2d2d2d;
    border-radius: 10px;
    padding: 12px 20px;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.3), inset 0 1px 3px rgba(255, 255, 255, 0.5);
    position: relative;
    overflow: visible;
}

.hero-animation .plate-text {
    font-family: 'GmarketSans', 'Noto Sans KR', 'Malgun Gothic', sans-serif;
    font-size: 1.6rem;
    font-weight: 900;
    color: #1a1a1a;
    letter-spacing: 0.05em;
    text-align: center;
    white-space: nowrap;
    transform: scaleX(0.9);
}

.hero-animation .scan-laser {
    position: absolute;
    top: -30px;
    left: -10%;
    width: 8%;
    height: calc(100% + 60px);
    background: linear-gradient(90deg, 
        transparent, 
        rgba(0, 150, 255, 0.3), 
        rgba(0, 200, 255, 0.6), 
        rgba(0, 150, 255, 0.3), 
        transparent
    );
    box-shadow: 0 0 20px rgba(0, 150, 255, 0.8);
    pointer-events: none;
    opacity: 0;
}

.hero-animation .envelope {
    position: absolute;
    top: -100px;
    right: 10px;
    width: 50px;
    height: 50px;
    opacity: 0;
    background-image: url('assets/img/envelope.png');
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    filter: drop-shadow(0 4px 15px rgba(102, 126, 234, 0.3));
}

.hero-animation .checkmark {
    position: absolute;
    top: 50%;
    right: -60px;
    transform: translateY(-50%) scale(0);
    width: 50px;
    height: 50px;
    background: #10b981;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 15px rgba(16, 185, 129, 0.4);
    opacity: 0;
}

.hero-animation .checkmark::after {
    content: '✓';
    color: white;
    font-size: 30px;
    font-weight: bold;
}

/* Search Form */
.search-form {
    display: flex;
    gap: var(--spacing-sm);
    max-width: 500px;
    margin: 0 auto;
}

.search-form input {
    font-family: 'GmarketSans', sans-serif;
    font-weight: 500;
    flex: 1;
    padding: var(--spacing-md);
    font-size: 1rem;
    border: 2px solid var(--border-color);
    border-radius: 9999px;
    min-height: 44px;
}

.search-form input:focus {
    outline: none;
    border-color: var(--primary-color);
}

.search-form button {
    font-family: 'GmarketSans', sans-serif;
    padding: var(--spacing-sm) var(--spacing-md);
    font-size: 0.875rem;
    font-weight: 700;
    color: white;
    background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
    border: none;
    border-radius: 9999px;
    cursor: pointer;
    min-width: auto;
    min-height: 36px;
    white-space: nowrap;
    position: relative;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(37, 99, 235, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.3);
    transition: all 0.3s ease;
}

.search-form button::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    transition: left 0.5s ease;
}

.search-form button:hover::before {
    left: 100%;
}

.search-form button:hover {
    background: linear-gradient(135deg, #1d4ed8 0%, #1e40af 100%);
    box-shadow: 0 6px 20px rgba(37, 99, 235, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.4);
    transform: translateY(-2px);
}

.search-form button:active {
    transform: scale(0.98) translateY(0);
    box-shadow: 0 2px 10px rgba(37, 99, 235, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

/* Loading Spinner Animation for Search Button */
.search-form button.searching {
    pointer-events: none;
    position: relative;
}

.search-form button.searching::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: searchSpinner 0.8s linear infinite;
}

@keyframes searchSpinner {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(360deg);
    }
}

/* Share Button */
/* Stats Boxes */
.stats-boxes {
    display: flex;
    gap: var(--spacing-sm);
    margin-top: var(--spacing-md);
    width: 100%;
}

.stat-box {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: var(--spacing-sm) var(--spacing-md);
    background-color: white;
    border: 2px solid var(--primary-color);
    border-radius: 9999px;
    min-height: 60px;
}

.stat-label {
    font-family: 'GmarketSans', sans-serif;
    font-size: 0.75rem;
    font-weight: 500;
    color: #666;
    margin-bottom: 4px;
}

.stat-value {
    font-family: 'GmarketSans', sans-serif;
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--primary-color);
}

.share-button {
    font-family: 'GmarketSans', sans-serif;
    padding: var(--spacing-md) var(--spacing-xl);
    font-size: 1rem;
    font-weight: 700;
    color: var(--primary-color);
    background-color: white;
    border: 2px solid var(--primary-color);
    border-radius: 9999px;
    cursor: pointer;
    min-width: 44px;
    min-height: 44px;
    margin-top: var(--spacing-md);
}

.share-button:hover {
    background-color: var(--bg-secondary);
}

/* Sections */
.leaderboard-section,
.stats-section,
.carousel-section,
.info-section,
.legal-section {
    padding: var(--spacing-md);
    margin-bottom: var(--spacing-xl);
}

/* Only apply background to non-full-screen sections */
.leaderboard-section:not(.full-screen-section),
.stats-section:not(.full-screen-section),
.carousel-section:not(.full-screen-section),
.info-section:not(.full-screen-section),
.legal-section:not(.full-screen-section) {
    background-color: var(--bg-primary);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-md);
}

.leaderboard-section h2,
.stats-section h2,
.carousel-section h2,
.info-section h2,
.legal-section h3 {
    margin-bottom: var(--spacing-lg);
    color: var(--text-primary);
    font-weight: 700;
}

.info-section p,
.legal-section p {
    line-height: 1.8;
    color: var(--text-secondary);
    margin-bottom: var(--spacing-sm);
}

.legal-section p:last-child {
    margin-bottom: 0;
}

/* Section padding already applied globally */

/* Tabs */
.tabs {
    display: flex;
    gap: var(--spacing-sm);
    margin-bottom: var(--spacing-lg);
    flex-wrap: wrap;
}

.tab {
    font-family: 'GmarketSans', sans-serif;
    font-weight: 500;
    padding: var(--spacing-sm) var(--spacing-md);
    font-size: 0.875rem;
    background-color: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 9999px;
    cursor: pointer;
    min-width: 44px;
    min-height: 44px;
}

.tab:hover {
    background-color: var(--border-color);
}

.tab.active {
    font-weight: 700;
    background-color: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

/* Tables */
table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0 8px;
}

thead {
    background-color: var(--bg-secondary);
}

th,
td {
    padding: var(--spacing-md);
    text-align: center;
    border-bottom: 1px solid var(--border-color);
}

th {
    font-family: 'GmarketSans', sans-serif;
    font-weight: 700;
    color: var(--text-secondary);
}

/* Leaderboard rank styling */
tbody tr td:first-child {
    font-family: 'GmarketSans', sans-serif;
    font-weight: 700;
    font-size: 1.2rem;
}

/* Gold, Silver, Bronze colors for top 3 */
tbody tr:nth-child(1) td:first-child {
    color: #fbbf24;
}

tbody tr:nth-child(2) td:first-child {
    color: #9ca3af;
}

tbody tr:nth-child(3) td:first-child {
    color: #cd7f32;
}

/* Plate number styling */
tbody tr td:nth-child(2) .plate-link {
    font-family: 'GmarketSans', sans-serif;
    font-weight: 700;
    color: var(--primary-color);
}

/* Score/count styling */
tbody tr td:nth-child(3),
tbody tr td:nth-child(4),
tbody tr td:nth-child(5) {
    font-family: 'GmarketSans', sans-serif;
    font-weight: 700;
    color: #10b981;
}

/* Leaderboard row styling with left accent */
tbody tr {
    background-color: var(--bg-primary);
    border-left: 5px solid var(--primary-color);
    transition: all 0.3s ease;
}

tbody tr:nth-child(odd) {
    background-color: var(--bg-primary);
}

tbody tr:nth-child(even) {
    background-color: var(--bg-secondary);
}

tbody tr:hover {
    background-color: var(--border-color);
    cursor: pointer;
    transform: translateY(-3px);
    box-shadow: 0 8px 16px rgba(0,0,0,0.15);
}

/* Rounded corners for leaderboard rows */
tbody tr td:first-child {
    border-top-left-radius: 8px;
    border-bottom-left-radius: 8px;
}

tbody tr td:last-child {
    border-top-right-radius: 8px;
    border-bottom-right-radius: 8px;
}

/* Plate Links in Leaderboards */
.plate-link {
    font-family: 'GmarketSans', sans-serif;
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 700;
    transition: color 0.2s;
}

.plate-link:hover {
    color: #1d4ed8;
    text-decoration: underline;
}

.plate-link:visited {
    color: var(--primary-color);
}

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--spacing-md);
}

.stat-card {
    padding: var(--spacing-lg);
    background-color: var(--bg-secondary);
    border-radius: var(--border-radius);
    text-align: center;
}

.stat-card h4 {
    font-family: 'GmarketSans', sans-serif;
    font-weight: 500;
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin-bottom: var(--spacing-sm);
}

.stat-card p {
    font-family: 'GmarketSans', sans-serif;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-color);
}

/* Global Stats Category Cards */
.stat-category-card {
    padding: var(--spacing-lg);
    background-color: var(--bg-secondary);
    border-radius: var(--border-radius);
    border: 1px solid var(--border-color);
}

.stat-category-card h3 {
    font-family: 'GmarketSans', sans-serif;
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: var(--spacing-md);
    padding-bottom: var(--spacing-sm);
    border-bottom: 2px solid var(--border-color);
}

.stat-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--spacing-sm) 0;
    border-bottom: 1px solid var(--border-color);
}

.stat-item:last-child {
    border-bottom: none;
}

.stat-label {
    font-family: 'GmarketSans', sans-serif;
    font-weight: 300;
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.stat-value {
    font-family: 'GmarketSans', sans-serif;
    font-size: 1rem;
    font-weight: 700;
    color: var(--primary-color);
}

/* Loading Indicator */
.loading {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    backdrop-filter: blur(2px);
}

.spinner {
    width: 50px;
    height: 50px;
    border: 4px solid var(--bg-secondary);
    border-top-color: var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Faster spinner animation for better perceived performance */
.spinner {
    animation-duration: 0.8s; /* Reduced from 1s */
}

@media (max-width: 767px) {
    .spinner {
        width: 40px;
        height: 40px;
        border-width: 3px;
    }
}

/* Notification */
.notification {
    position: fixed;
    top: var(--spacing-xl);
    right: var(--spacing-xl);
    padding: var(--spacing-md) var(--spacing-lg);
    background-color: var(--text-primary);
    color: white;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-lg);
    z-index: 1001;
    animation: slideIn 0.3s ease-out;
    max-width: 90%;
    word-wrap: break-word;
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* Faster notification animation for better perceived performance */
.notification {
    animation-duration: 0.2s; /* Reduced from 0.3s */
}

.notification.success {
    background-color: var(--secondary-color);
}

.notification.error {
    background-color: var(--danger-color);
}

.notification.info {
    background-color: var(--primary-color);
}

@media (max-width: 767px) {
    .notification {
        top: var(--spacing-md);
        right: var(--spacing-md);
        left: var(--spacing-md);
        padding: var(--spacing-sm) var(--spacing-md);
        font-size: 0.875rem;
    }
}

/* Carousel Section */
.carousel-section .splide {
    margin-top: var(--spacing-md);
}

.carousel-section .splide__slide {
    display: flex;
    align-items: center;
    justify-content: center;
}

.carousel-section .splide__slide img {
    width: 100%;
    height: auto;
    max-height: 70vh;
    object-fit: contain;
    border-radius: var(--border-radius);
}

.carousel-section .splide__arrow {
    background-color: transparent;
    opacity: 0.7;
    transition: opacity 0.3s ease;
}

.carousel-section .splide__arrow svg {
    fill: #d1d5db;
}

.carousel-section .splide__arrow:hover {
    opacity: 1;
}

.carousel-section .splide__arrow:hover svg {
    fill: #9ca3af;
}

.carousel-section .splide__pagination__page {
    width: 4.4px !important;
    height: 4.4px !important;
    min-width: 4.4px !important;
    min-height: 4.4px !important;
}

.carousel-section .splide__pagination__page.is-active {
    background-color: var(--primary-color);
}

@media (max-width: 767px) {
    .carousel-section .splide__slide img {
        max-height: 60vh;
    }
    
    .carousel-section .splide__arrow {
        width: 2em;
        height: 2em;
    }
}

/* Ad Placeholder */
.ad-placeholder {
    background-color: var(--bg-secondary);
    border: 2px dashed var(--border-color);
    padding: var(--spacing-lg);
    text-align: center;
    color: var(--text-secondary);
    margin: var(--spacing-xl) 0;
    border-radius: var(--border-radius);
    min-height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Mobile ad dimensions: 320x50 for all screens */
.ad-placeholder {
    min-height: 50px;
    max-width: 320px;
    margin-left: auto;
    margin-right: auto;
}

/* Plate Page Specific */
.search-bar {
    background-color: var(--bg-primary);
    padding: var(--spacing-md);
    box-shadow: var(--shadow-sm);
    margin-bottom: var(--spacing-lg);
}

.plate-header {
    text-align: center;
    padding: var(--spacing-md);
    background-color: var(--bg-primary);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-md);
    margin-bottom: var(--spacing-xl);
}

.plate-header h1 {
    font-size: 2rem;
    color: var(--primary-color);
    margin-bottom: var(--spacing-sm);
}

/* Chart Section */
.chart-section {
    background-color: var(--bg-primary);
    padding: var(--spacing-md);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-md);
    margin-bottom: var(--spacing-xl);
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.chart-section canvas {
    width: 100% !important;
    max-width: 100%;
    height: auto !important;
    max-height: 300px;
}

#plateChart {
    max-height: 300px;
    width: 100%;
    min-height: 200px;
}

/* Monthly Trend Section */
.monthly-trend-section {
    background-color: var(--bg-primary);
    padding: var(--spacing-md);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-md);
    margin-bottom: var(--spacing-xl);
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.monthly-trend-section h2 {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: var(--spacing-md);
    text-align: center;
    padding-bottom: var(--spacing-xs);
    border-bottom: 2px solid var(--bg-secondary);
}

.monthly-trend-section canvas {
    width: 100% !important;
    max-width: 100%;
    height: auto !important;
    max-height: 250px;
    display: block;
    margin: 0 auto;
}

#monthlyTrendChart {
    max-height: 250px;
    width: 100%;
    min-height: 180px;
}

/* Category Trend Charts */
.category-trend {
    margin-top: var(--spacing-md);
    padding-top: var(--spacing-md);
    border-top: 1px solid var(--bg-secondary);
}

.category-trend h4 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: var(--spacing-sm);
    text-align: center;
}

.category-trend canvas {
    width: 100% !important;
    max-width: 100%;
    height: 200px !important;
    max-height: 200px;
    display: block;
    margin: 0 auto;
}

/* Mobile chart adjustments - already applied globally */

/* Landscape orientation on mobile */
@media (max-width: 767px) and (orientation: landscape) {
    #plateChart {
        max-height: 250px;
        min-height: 180px;
    }
    
    #monthlyTrendChart {
        max-height: 200px;
        min-height: 150px;
    }
    
    .monthly-trend-section {
        padding: var(--spacing-md);
        margin-bottom: var(--spacing-md);
    }
    
    .monthly-trend-section h2 {
        font-size: 1rem;
        margin-bottom: var(--spacing-sm);
    }
    
    .category-trend canvas {
        height: 160px !important;
        max-height: 160px;
    }
    
    .hero h1 {
        font-size: 1.125rem;
    }
    
    .plate-header h1 {
        font-size: 1.75rem;
    }
    
    .hero,
    .plate-header {
        padding: var(--spacing-md);
    }
}

/* Counter Buttons */
.counters-section {
    background-color: var(--bg-primary);
    padding: var(--spacing-md);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-md);
    margin-bottom: var(--spacing-xl);
}

.category-group {
    margin-bottom: var(--spacing-xl);
}

.category-group:last-child {
    margin-bottom: 0;
}

.category-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--spacing-md);
}

.category-group h3 {
    margin-bottom: 0;
    color: var(--text-primary);
}

.chart-toggle-btn {
    background: transparent;
    border: none;
    border-radius: 8px;
    padding: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 1;
}

.chart-toggle-btn:hover {
    opacity: 1;
    transform: scale(1.1);
}

.chart-toggle-btn:active {
    transform: scale(0.95);
}

.chart-toggle-btn img {
    display: block;
    width: 24px;
    height: 24px;
    opacity: 1;
    transition: opacity 0.2s ease;
}

.chart-toggle-btn:hover img {
    opacity: 0.8;
}

.chart-toggle-btn .icon-bar,
.chart-toggle-btn .icon-doughnut {
    transition: opacity 0.2s ease;
}

.counter-buttons {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--spacing-md);
}

.counter-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: var(--spacing-md);
    background-color: var(--bg-secondary);
    border: 2px solid var(--border-color);
    border-radius: var(--border-radius);
    cursor: pointer;
    min-width: 44px;
    min-height: 44px;
    transition: all 0.15s; /* Reduced from 0.2s for snappier feel */
}

.counter-btn:hover {
    background-color: var(--border-color);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.counter-btn:active {
    transform: translateY(0);
}

.counter-btn .label {
    font-family: 'GmarketSans', sans-serif;
    font-weight: 500;
    font-size: 0.8125rem;
    color: var(--text-secondary);
    margin-bottom: var(--spacing-sm);
    text-align: center;
}

.counter-btn .count {
    font-family: 'GmarketSans', sans-serif;
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--primary-color);
}

/* Category-specific button styles */
.category-group:has(h3:contains("고장수리")) .counter-btn,
.category-group:nth-child(1) .counter-btn {
    background-color: var(--repair-bg);
    border-color: var(--repair-border);
}

.category-group:nth-child(1) .counter-btn:hover {
    background-color: var(--repair-border);
}

.category-group:nth-child(1) .counter-btn .count {
    color: var(--repair-color);
}

.category-group:nth-child(2) .counter-btn {
    background-color: var(--safety-bg);
    border-color: var(--safety-border);
}

.category-group:nth-child(2) .counter-btn:hover {
    background-color: var(--safety-border);
}

.category-group:nth-child(2) .counter-btn .count {
    color: var(--safety-color);
}

.category-group:nth-child(3) .counter-btn {
    background-color: var(--thanks-bg);
    border-color: var(--thanks-border);
}

.category-group:nth-child(3) .counter-btn:hover {
    background-color: var(--thanks-border);
}

.category-group:nth-child(3) .counter-btn .count {
    color: var(--thanks-color);
}

.counter-btn.likes-btn,
.category-group:nth-child(4) .counter-btn {
    background-color: var(--likes-bg);
    border-color: var(--likes-border);
}

.counter-btn.likes-btn:hover,
.category-group:nth-child(4) .counter-btn:hover {
    background-color: var(--likes-border);
}

.counter-btn.likes-btn .count,
.category-group:nth-child(4) .counter-btn .count {
    color: var(--likes-color);
}

/* Share Section */
.share-section {
    text-align: center;
    margin-bottom: var(--spacing-xl);
}

/* Notices */
.notices {
    background-color: var(--bg-primary);
    padding: var(--spacing-lg);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-sm);
    margin-bottom: var(--spacing-xl);
}

.notices p {
    margin-bottom: var(--spacing-sm);
    color: var(--text-secondary);
    line-height: 1.6;
}

.notices p:last-child {
    margin-bottom: 0;
}

/* Utility Classes */
.hidden {
    display: none !important;
}

.text-center {
    text-align: center;
}

.mt-0 { margin-top: 0; }
.mt-1 { margin-top: var(--spacing-sm); }
.mt-2 { margin-top: var(--spacing-md); }
.mt-3 { margin-top: var(--spacing-lg); }
.mt-4 { margin-top: var(--spacing-xl); }

.mb-0 { margin-bottom: 0; }
.mb-1 { margin-bottom: var(--spacing-sm); }
.mb-2 { margin-bottom: var(--spacing-md); }
.mb-3 { margin-bottom: var(--spacing-lg); }
.mb-4 { margin-bottom: var(--spacing-xl); }

/* Responsive Design - Mobile First */
/* All screens use mobile-friendly single column layout for consistency */

/* Mobile specific (below 768px) */
@media (max-width: 767px) {
    .tabs {
        justify-content: center;
    }

    .tab {
        flex: 1;
        min-width: 60px;
        font-size: 0.75rem;
        padding: var(--spacing-sm);
    }

    table {
        font-size: 0.875rem;
    }

    th,
    td {
        padding: var(--spacing-sm);
    }
    
    /* Reduce left border accent on mobile */
    tbody tr {
        border-left-width: 3px;
    }

    .notification {
        right: var(--spacing-md);
        left: var(--spacing-md);
        top: var(--spacing-md);
    }
    
    .category-trend h4 {
        font-size: 0.9375rem;
    }
    
    .category-trend canvas {
        height: 180px !important;
        max-height: 180px;
    }
}

/* Extra small mobile devices (320px - 375px) */
@media (max-width: 375px) {
    .hero h1 {
        font-size: 1.125rem;
    }
    
    .plate-header h1 {
        font-size: 1.75rem;
    }
    
    .tab {
        font-size: 0.6875rem;
        padding: var(--spacing-xs) var(--spacing-sm);
        min-width: 50px;
    }
    
    .counter-btn .label {
        font-size: 0.75rem;
    }
    
    .counter-btn .count {
        font-size: 1.125rem;
    }
    
    .container {
        padding: var(--spacing-sm);
    }
    
    #monthlyTrendChart {
        max-height: 220px;
        min-height: 160px;
    }
    
    .monthly-trend-section h2 {
        font-size: 1rem;
    }
}

/* Touch Action Optimization */
button,
a,
.tab,
.counter-btn,
input[type="submit"],
input[type="button"],
.plate-link {
    touch-action: manipulation;
}

/* Smooth scrolling for mobile */
body {
    -webkit-overflow-scrolling: touch;
}

/* Ensure minimum touch target sizes */
button:not(.nav-toggle),
.tab,
.counter-btn,
.share-button,
input[type="submit"],
input[type="button"],
a.clickable,
.plate-link {
    min-width: var(--min-touch-target);
    min-height: var(--min-touch-target);
}

/* Nav toggle has custom smaller size */
.nav-toggle {
    min-width: unset;
    min-height: unset;
}

/* Ensure table rows are touch-friendly */
tbody tr {
    min-height: var(--min-touch-target);
}

tbody td {
    min-height: var(--min-touch-target);
    vertical-align: middle;
}

/* Accessibility - Focus states */
button:focus,
input:focus,
.tab:focus,
.counter-btn:focus {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

/* Accessibility - Reduced motion */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Mobile-specific performance optimizations */
@media (max-width: 767px) {
    /* Optimize animations for mobile */
    .counter-btn:hover {
        transform: none;
    }
    
    .counter-btn:active {
        transform: scale(0.98);
    }
    
    /* Improve tap highlighting */
    button,
    .tab,
    .counter-btn,
    .plate-link {
        -webkit-tap-highlight-color: rgba(37, 99, 235, 0.2);
    }
    
    /* Prevent text selection on buttons */
    button,
    .tab,
    .counter-btn {
        -webkit-user-select: none;
        -moz-user-select: none;
        -ms-user-select: none;
        user-select: none;
    }
    
    /* Optimize scrolling */
    .container {
        scroll-behavior: smooth;
    }
    
    /* Better input focus on mobile */
    input:focus {
        font-size: 16px; /* Prevents zoom on iOS */
    }
}

/* Portrait orientation specific */
@media (max-width: 767px) and (orientation: portrait) {
    .search-form {
        max-width: 100%;
    }
}

/* Landscape orientation specific */
@media (max-width: 767px) and (orientation: landscape) {
    .leaderboard-section,
    .stats-section,
    .counters-section {
        padding: var(--spacing-md);
    }
}

/* Very small screens (320px width) */
@media (max-width: 320px) {
    .hero h1 {
        font-size: 1rem;
    }
    
    .plate-header h1 {
        font-size: 1.5rem;
    }
    
    .search-form input,
    .search-form button {
        font-size: 0.875rem;
    }
    
    .tab {
        font-size: 0.625rem;
        padding: var(--spacing-xs);
        min-width: 44px;
    }
}

/* Navbar Styles */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    transition: box-shadow 0.3s ease;
}

.navbar.scrolled {
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

/* Top Row: Announcement Banner */
.announcement-banner {
    background: #0971CE;
    height: clamp(25px, 4vh, 35px);
    overflow: hidden;
    display: flex;
    align-items: center;
}

.announcement-text {
    font-family: 'GmarketSans', sans-serif;
    color: #FFFF00;
    font-weight: 700;
    font-size: clamp(0.75rem, 1.5vw, 0.9rem);
    white-space: nowrap;
    will-change: transform, opacity;
    text-shadow: 0 0 10px rgba(255, 255, 0, 0.5);
}

/* Bottom Row: Navigation */
.nav-container {
    background: transparent;
    height: clamp(45px, 8vh, 60px);
    max-width: 100%;
    padding: 0 clamp(0.5rem, 2vw, 1.5rem);
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: none;
}

.nav-logo img {
    height: clamp(30px, 5vh, 45px);
    width: auto;
    transition: height 0.3s ease;
}

.nav-menu {
    display: flex;
    list-style: none;
    gap: 2rem;
    margin: 0;
    padding: 0;
}

.nav-link {
    font-family: 'GmarketSans', sans-serif;
    color: white;
    text-decoration: none;
    font-weight: 500;
    font-size: clamp(0.85rem, 1.5vw, 1rem);
    transition: color 0.3s ease;
    padding: clamp(0.4rem, 1vw, 0.6rem) clamp(0.6rem, 1.5vw, 1rem);
    border-radius: 4px;
}

.nav-link:hover {
    color: #0971CE;
    background: rgba(255, 255, 255, 0.1);
}

.nav-toggle {
    display: none;
    width: 22px;
    height: 18px;
    background: transparent;
    border: none;
    cursor: pointer;
    z-index: 1001;
    flex-direction: column;
    justify-content: space-between;
    padding: 0;
    transition: transform 0.2s ease;
}

.nav-toggle:hover {
    transform: scale(1.05);
}

.nav-toggle:active {
    transform: scale(0.95);
}

.hamburger-line {
    width: 100%;
    height: 2px;
    background: white;
    border-radius: 1px;
    transition: background 0.2s ease;
}

.nav-toggle:hover .hamburger-line {
    background: rgba(255, 255, 255, 0.8);
}

/* Update Check Button */
.update-check-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    border: 2px solid rgba(255, 255, 255, 0.3);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    transition: all 0.3s ease;
    margin-left: 12px;
}

.update-check-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.5);
    transform: rotate(180deg);
}

.update-check-btn:active {
    transform: rotate(180deg) scale(0.9);
}

.update-check-btn.checking {
    animation: spin 1s linear infinite;
    pointer-events: none;
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}


@media (max-width: 768px) {
    .nav-container {
        justify-content: center;
        position: relative;
    }

    .nav-logo {
        margin: 0 auto;
    }

    .nav-logo img {
        height: clamp(24px, 4vh, 32px);
    }

    .update-check-btn {
        position: absolute;
        right: 3.5rem;
        top: 50%;
        transform: translateY(-50%);
        width: 36px;
        height: 36px;
        font-size: 1rem;
        margin-left: 0;
    }

    .nav-toggle {
        display: flex;
        position: absolute;
        right: 1rem;
        top: 50%;
        transform: translateY(-50%);
        width: 22px !important;
        height: 18px !important;
    }

    .hamburger-line {
        background: white;
        height: 2px !important;
    }

    .nav-toggle:hover .hamburger-line {
        background: rgba(255, 255, 255, 0.8);
    }

    .nav-menu {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: rgba(0, 0, 0, 0.9);
        backdrop-filter: blur(10px);
        flex-direction: column;
        gap: 0;
        padding: 1rem 0;
        box-shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
    }

    .nav-menu.active {
        display: flex;
    }

    .nav-menu li {
        text-align: center;
        padding: 0.5rem 0;
    }

    .nav-link {
        display: block;
        padding: 0.75rem 1rem;
    }

}

/* Footer Styles */
.site-footer {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 2rem 1rem;
    margin-top: 3rem;
    text-align: center;
}

.footer-content {
    max-width: 1200px;
    margin: 0 auto;
}

.copyright {
    font-size: 0.9rem;
    margin-top: 1rem;
    opacity: 0.9;
}

.footer-links {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0;
    flex-wrap: wrap;
    font-size: 0.95rem;
}

.footer-links a {
    color: white;
    text-decoration: none;
    transition: opacity 0.3s ease;
    padding: 0.5rem;
}

.footer-links a:hover {
    opacity: 0.8;
}

.footer-contact-link {
    color: white !important;
    text-decoration: none !important;
    display: block;
    text-align: center;
    margin-top: 0.5rem;
    transition: opacity 0.3s ease;
}

.footer-contact-link:hover {
    opacity: 0.8;
}

@media (max-width: 768px) {
    .footer-links {
        font-size: 0.85rem;
    }
    
    .copyright {
        font-size: 0.85rem;
    }
}

/* Plate Types Section */
/* Font removed - using GmarketSans for all text including license plates */

.plate-types-section {
    background-color: var(--bg-primary);
}

.plates-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 40px;
    justify-items: center;
    margin-top: var(--spacing-xl);
}

/* Flip card container */
.plates-grid .plate-flip-container {
    perspective: 1000px;
    width: 280px;
    height: 80px;
    margin-bottom: 0;
}

.plates-grid .plate-flip-tall {
    height: 160px;
}

.plates-grid .plate-flipper {
    position: relative;
    width: 100%;
    height: 100%;
    transition: transform 0.6s;
    transform-style: preserve-3d;
}

.plates-grid .plate-front,
.plates-grid .plate-back {
    position: absolute;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
    background: white;
    border: 3px solid #000;
    border-radius: 12px;
    padding: 10px 15px;
    font-family: 'GmarketSans', 'Malgun Gothic', sans-serif;
    font-weight: 700;
    font-size: 2.2rem;
    letter-spacing: 0px;
    line-height: 1;
    box-shadow: 0 8px 16px rgba(0,0,0,0.3);
    color: #000;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

/* Glassy shine effect for all plates */
.plates-grid .plate-front::before,
.plates-grid .plate-back::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        135deg,
        rgba(255, 255, 255, 0.4) 0%,
        rgba(255, 255, 255, 0.2) 25%,
        rgba(255, 255, 255, 0) 50%,
        rgba(255, 255, 255, 0) 100%
    );
    border-radius: 9px;
    pointer-events: none;
    z-index: 10;
}

.plates-grid .plate-back {
    transform: rotateY(180deg);
}

.plates-grid .plate-back-text {
    font-family: 'GmarketSans', 'Malgun Gothic', sans-serif;
    font-size: 1.5rem;
    font-weight: 700;
    text-align: center;
    z-index: 1;
    transform: scaleX(0.9);
}

.plates-grid .plate-text,
.plates-grid .horizontal-number,
.plates-grid .row-bottom {
    font-family: 'GmarketSans', 'Malgun Gothic', sans-serif;
    font-weight: 700;
    transform: scaleX(0.9);
    transform-origin: center;
}

/* Plate type colors and styles */
.plates-grid .plate-general {
    background: white;
}

.plates-grid .plate-general-variant {
    background: linear-gradient(to right, #003399 28px, white 28px);
    justify-content: flex-end;
    padding-right: 20px;
}

.plates-grid .plate-eco {
    background: #87CEEB;
}

.plates-grid .plate-commercial {
    background: #FFD700;
    padding: 10px 8px;
}

.plates-grid .plate-corporate {
    background: linear-gradient(to right, #003399 28px, #CCFF00 28px);
    justify-content: flex-end;
    padding-right: 20px;
}

/* Plates 2-6 now use default plate 1 settings (removed custom overrides) */

/* Plate 4 and 6 - set font-size to 2.2rem */
.plates-grid .plate-flip-container:nth-child(4) .plate-front .horizontal-number,
.plates-grid .plate-flip-container:nth-child(6) .plate-front .horizontal-number {
    font-size: 2.2rem;
}

.plates-grid .plate-diplomatic {
    background: #000080;
    color: white;
    padding: 10px 8px;
}

.plates-grid .plate-diplomatic .plate-back-text {
    color: white;
}

.plates-grid .plate-construction {
    background: #FF8C00;
    color: white;
    border: 3px solid #FF8C00;
    box-shadow: inset 0 0 0 3px white, 0 8px 16px rgba(0,0,0,0.3);
}

.plates-grid .plate-construction .plate-back-text {
    color: white;
}

/* Vertical text layout */
.plates-grid .plate-text-vertical {
    display: flex;
    align-items: center;
    gap: 4px;
    z-index: 1;
    width: 100%;
    justify-content: flex-start;
    padding-left: 5px;
}

.plates-grid .vertical-prefix {
    font-size: 1.4rem;
    letter-spacing: 0;
    writing-mode: vertical-rl;
    position: relative;
    top: -1.0rem;
}

.plates-grid .horizontal-number {
    font-size: 2.2rem;
    letter-spacing: 0px;
}

/* Two-row layout for construction plate */
.plates-grid .plate-text-two-rows {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    z-index: 1;
}

.plates-grid .row-top {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 1.8rem;
    letter-spacing: 4px;
}

.plates-grid .row-bottom {
    font-size: 2.2rem;
    letter-spacing: 2px;
}

/* Circle with 영 character */
.plates-grid .circle-yeong {
    width: 40px;
    height: 40px;
    border: 2px solid white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    font-weight: bold;
    background: transparent;
    color: white;
}

/* Motorbike plates */
.plates-grid .plate-flip-motorbike {
    width: 180px;
    height: 140px;
}

/* Plate 9 specific container */
.plates-grid .plate-motorbike-old.plate-flip-motorbike {
    height: 100px;
}

/* Fix white corners for plate 9 */
.plates-grid .plate-motorbike-old .plate-flipper {
    background: transparent;
}

.plates-grid .plate-motorbike-new {
    background: white;
    border-color: #000;
    color: #000;
}

.plates-grid .plate-motorbike-old {
    border-color: #0066CC;
    color: #0066CC;
}

.plates-grid .plate-motorbike-old .plate-front,
.plates-grid .plate-motorbike-old .plate-back {
    border-color: #0066CC;
    color: #0066CC;
    padding-top: 0;
    padding-bottom: 0;
    background: white;
    overflow: hidden;
}

.plates-grid .plate-text-motorbike {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    z-index: 1;
}

.plates-grid .motorbike-row1 {
    font-size: 2rem;
    letter-spacing: 0px;
}

.plates-grid .motorbike-row2 {
    font-size: 2.5rem;
    letter-spacing: 0px;
}

.plates-grid .motorbike-row2-split {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 0 15px;
}

.plates-grid .motorbike-row2-left {
    font-size: 1.5rem;
    letter-spacing: 0px;
}

.plates-grid .motorbike-row2-right {
    font-size: 2.5rem;
    letter-spacing: 0px;
    flex: 1;
    text-align: center;
}

/* Plate 9 specific styling */
.plates-grid .plate-motorbike-old .motorbike-row1 {
    font-size: 1.5rem;
}

@media (max-width: 768px) {
    .plates-grid {
        grid-template-columns: 1fr;
        gap: 30px;
    }

    .plates-grid .plate {
        font-size: 1.8rem;
        padding: 8px 12px;
        width: 240px;
        height: 70px;
    }

    .plates-grid .plate-construction {
        height: 140px;
    }

    .plates-grid .horizontal-number {
        font-size: 1.5rem;
        letter-spacing: 0.5px;
    }

    .plates-grid .row-bottom {
        font-size: 1.8rem;
        letter-spacing: 1px;
    }
}

@media (max-width: 480px) {
    .plates-grid .plate {
        font-size: 1.5rem;
        padding: 6px 10px;
        width: 200px;
        height: 60px;
    }

    .plates-grid .plate-construction {
        height: 120px;
    }

    .plates-grid .horizontal-number {
        font-size: 1.5rem;
        letter-spacing: 0px;
    }

    .plates-grid .row-bottom {
        font-size: 1.5rem;
        letter-spacing: 0.5px;
    }

    .plates-grid .vertical-prefix {
        font-size: 1.2rem;
    }

    .plates-grid .circle-yeong {
        width: 30px;
        height: 30px;
        font-size: 1.1rem;
        border-width: 2px;
    }

    .plates-grid .row-top {
        font-size: 1.4rem;
        letter-spacing: 2px;
        gap: 5px;
    }
}

/* Likes Section Styling */
.likes-section {
    text-align: center;
    margin: var(--spacing-xl) 0;
    padding: var(--spacing-lg);
}

.likes-section .likes-btn {
    width: 100%;
    max-width: 400px;
    padding: 15px 30px;
    font-size: 1.1rem;
    font-weight: 600;
    background-color: #e0e0e0;
    border: 2px solid #bdbdbd;
    border-radius: var(--border-radius);
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.likes-section .likes-btn:hover {
    background-color: #d0d0d0;
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.likes-section .likes-btn.clicked {
    background-color: #ff6b6b;
    border-color: #ff5252;
    color: white;
}

.likes-section .likes-btn.clicked:hover {
    background-color: #ff5252;
}

/* Scroll Navigation Section */
.scroll-nav-section {
    display: flex;
    gap: var(--spacing-md);
    justify-content: center;
    margin: var(--spacing-xl) 0;
    padding: 0 var(--spacing-md);
}

.scroll-nav-btn {
    flex: 1;
    max-width: 200px;
    padding: 12px 24px;
    font-size: 1rem;
    font-weight: 600;
    background-color: var(--primary-color);
    color: white;
    border: none;
    border-radius: var(--border-radius);
    cursor: pointer;
    transition: all 0.3s ease;
}

/* New Plate Page Design - Option 1 Clean Vertical Flow */
.search-section {
    padding: 8px 0;
    padding-top: 80px;
    margin-bottom: 0;
}

.search-form {
    display: flex;
    gap: 8px;
}

.search-input {
    flex: 1;
    padding: 10px 15px;
    border: 1px solid #e9ecef;
    border-radius: 10px;
    font-size: 14px;
    outline: none;
    transition: border-color 0.3s;
}

.search-input:focus {
    border-color: #667eea;
}

.search-input::placeholder {
    color: #999;
}

.search-btn {
    padding: 10px 20px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s;
}

.search-btn:active {
    transform: scale(0.95);
}

.plate-section {
    padding: 25px 0;
    border-bottom: 1px solid #f0f0f0;
    margin-bottom: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
}

.plate-number {
    font-size: 48px;
    font-weight: 900;
    color: #1a1a1a;
    letter-spacing: 2px;
    text-align: center;
    margin: 0;
}

.like-heart-wrapper {
    position: relative;
    display: inline-block;
}

.like-heart {
    font-size: 32px;
    cursor: pointer;
    user-select: none;
    position: relative;
    z-index: 2;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.like-heart.inactive {
    color: #ccc;
    filter: grayscale(100%);
}

.like-heart.active {
    color: #e0245e;
    animation: heartPop 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes heartPop {
    0% { transform: scale(1); }
    50% { transform: scale(1.3); }
    100% { transform: scale(1); }
}

.like-heart-wrapper::before,
.like-heart-wrapper::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 10px;
    height: 10px;
    background: #e0245e;
    border-radius: 50%;
    opacity: 0;
    transform: translate(-50%, -50%);
}

.like-heart-wrapper.burst::before {
    animation: particle1 0.6s ease-out;
}

.like-heart-wrapper.burst::after {
    animation: particle2 0.6s ease-out;
}

@keyframes particle1 {
    0% {
        opacity: 1;
        transform: translate(-50%, -50%) scale(0);
    }
    50% {
        opacity: 0.8;
    }
    100% {
        opacity: 0;
        transform: translate(-80%, -80%) scale(1.5);
    }
}

@keyframes particle2 {
    0% {
        opacity: 1;
        transform: translate(-50%, -50%) scale(0);
    }
    50% {
        opacity: 0.8;
    }
    100% {
        opacity: 0;
        transform: translate(-20%, -20%) scale(1.5);
    }
}

.particle {
    position: absolute;
    width: 8px;
    height: 8px;
    background: #e0245e;
    border-radius: 50%;
    pointer-events: none;
    opacity: 0;
}

.particle.animate {
    animation: particleBurst 0.6s ease-out forwards;
}

@keyframes particleBurst {
    0% {
        opacity: 1;
        transform: translate(0, 0) scale(0);
    }
    50% {
        opacity: 0.8;
    }
    100% {
        opacity: 0;
        transform: translate(var(--tx), var(--ty)) scale(1);
    }
}

.stats-row-section {
    display: flex;
    gap: 6px;
    margin: 15px 0;
    justify-content: center;
    flex-wrap: wrap;
}

.stat-box {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    background: #f8f9fa;
    border-radius: 20px;
    padding: 12px 18px;
    border: 1px solid #e9ecef;
    flex: 1;
    min-height: 50px;
}

.stat-box-with-tooltip {
    position: relative;
    justify-content: center;
    cursor: pointer;
}

.stat-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}

.stat-tooltip {
    position: absolute;
    bottom: -30px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 12px;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
    z-index: 10;
}

.stat-box-with-tooltip:hover .stat-tooltip,
.stat-box-with-tooltip:active .stat-tooltip {
    opacity: 1;
}

.send-message-btn {
    background: linear-gradient(135deg, #87CEEB 0%, #4FC3F7 100%);
    border: 1px solid #4FC3F7;
    position: relative;
    overflow: hidden;
    cursor: pointer;
    transition: transform 0.2s ease;
    flex: 1;
    justify-content: center;
}

.send-message-btn .button-content,
.good-message-btn .button-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
}

.good-message-btn {
    background: linear-gradient(135deg, #FFB6C1 0%, #FF69B4 100%);
    border: 1px solid #FF69B4;
    position: relative;
    overflow: hidden;
    cursor: pointer;
    transition: transform 0.2s ease;
    flex: 1;
    justify-content: center;
}

.good-message-btn .stat-label {
    color: #fff;
    font-weight: 600;
    font-size: 15px;
    line-height: 1.2;
}

.good-message-btn::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(
        45deg,
        transparent 30%,
        rgba(255, 255, 255, 0.4) 50%,
        transparent 70%
    );
    animation: glassyShine 3s infinite;
}

.good-message-btn:hover {
    transform: scale(1.05);
}

.good-message-btn:active {
    transform: scale(0.98);
}

.share-row {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
}

.share-row .stat-box {
    flex: 1;
    justify-content: center;
}

.share-row .stat-label {
    font-size: 16px;
    font-weight: 600;
}

.share-row .stat-icon {
    font-size: 18px;
}

.send-message-btn .stat-label {
    color: #fff;
    font-weight: 600;
    font-size: 15px;
    line-height: 1.2;
}

.send-message-btn::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(
        45deg,
        transparent 30%,
        rgba(255, 255, 255, 0.4) 50%,
        transparent 70%
    );
    animation: glassyShine 3s infinite;
}

.send-message-btn:hover {
    transform: scale(1.05);
}

.send-message-btn:active {
    transform: scale(0.98);
}

@keyframes glassyShine {
    0% {
        transform: translate(-100%, -100%) rotate(45deg);
    }
    100% {
        transform: translate(100%, 100%) rotate(45deg);
    }
}

.stat-icon {
    font-size: 20px;
}

.stat-value {
    font-size: 18px;
    font-weight: bold;
    color: #333;
}

.stat-label {
    font-size: 13px;
    color: #999;
    font-weight: 500;
}

.chart-section {
    margin: 20px 0;
}

.chart-container {
    background: #fafafa;
    border-radius: 12px;
    padding: 15px 15px 30px 15px;
    margin: 15px 0;
    border: 1px solid #e9ecef;
}

.chart-title {
    font-size: 13px;
    font-weight: 600;
    color: #666;
    margin-bottom: 10px;
}

.chart-bars {
    display: flex;
    align-items: flex-end;
    gap: 8px;
    height: 100px;
    position: relative;
}

.chart-bar {
    flex: 1;
    background: linear-gradient(180deg, #667eea 0%, #764ba2 100%);
    border-radius: 4px 4px 0 0;
    position: relative;
    transition: height 0.3s ease;
}

.chart-bar-label {
    position: absolute;
    bottom: -25px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 11px;
    color: #999;
    white-space: nowrap;
}

.chart-bar-value {
    position: absolute;
    top: -22px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 11px;
    font-weight: 600;
    color: #667eea;
    background: white;
    padding: 2px 6px;
    border-radius: 4px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    white-space: nowrap;
}

.action-list-section {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin: 20px 0;
}

.action-btn {
    background: white;
    border: 1px solid #e9ecef;
    border-radius: 10px;
    padding: 14px 16px;
    font-size: 14px;
    font-weight: 500;
    color: #333;
    text-align: left;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    transition: all 0.3s ease;
}

.action-emoji {
    font-size: 20px;
    margin-right: 4px;
}

.action-btn::after {
    content: '→';
    color: #999;
}

.action-btn:hover {
    background: #f8f9fa;
    border-color: #667eea;
}

.action-btn:active {
    transform: scale(0.98);
}

.scroll-nav-btn:hover {
    background-color: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.scroll-nav-btn:active {
    transform: translateY(0);
}

/* Stats Section */
.stats-section {
    margin-bottom: var(--spacing-xl);
}

.stats-section .category-group {
    margin-bottom: var(--spacing-xl);
}

/* Messages Section */
.messages-section {
    margin-bottom: var(--spacing-xl);
}

.messages-section .category-group {
    margin-bottom: var(--spacing-xl);
}

/* New Message Card Design */
.message-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 16px;
    margin-bottom: 30px;
}

.message-card {
    background: white;
    border: 2px solid #e0e0e0;
    border-radius: 12px;
    padding: 10px 16px;
    transition: all 0.3s ease;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    height: auto;
    min-height: 50px;
}

.message-card:hover {
    border-color: #667eea;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.15);
    transform: translateY(-2px);
}

.card-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: nowrap;
}

.card-left {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1;
    min-width: 0;
}

.card-emoji {
    font-size: 1.4rem;
    flex-shrink: 0;
    line-height: 1;
}

.card-message {
    font-size: 0.9rem;
    color: #2c3e50;
    font-weight: 500;
    flex: 1;
    min-width: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.send-count {
    font-size: 0.8rem;
    color: #95a5a6;
    font-weight: 600;
    white-space: nowrap;
    flex-shrink: 0;
    margin-right: 4px;
}

.send-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 6px 16px;
    border-radius: 16px;
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: 500;
    transition: all 0.2s ease;
    white-space: nowrap;
    flex-shrink: 0;
    position: relative;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}

.send-btn::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -100%;
    width: 50%;
    height: 200%;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(255, 255, 255, 0.3),
        transparent
    );
    transform: skewX(-25deg);
    animation: glassShine 2.5s infinite;
}

@keyframes glassShine {
    0% {
        left: -100%;
    }
    50%, 100% {
        left: 200%;
    }
}

.send-btn:hover {
    background: linear-gradient(135deg, #5568d3 0%, #6a3d91 100%);
    transform: scale(1.05);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.5);
}

.send-btn:active {
    transform: scale(0.95);
}

/* Envelope animation */
.envelope {
    position: fixed;
    width: 60px;
    height: 60px;
    pointer-events: none;
    z-index: 10000;
    opacity: 0;
}

@keyframes flyUp {
    0% {
        opacity: 0;
        transform: translate(-50%, -50%) scale(0.5) rotate(0deg);
    }
    20% {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1) rotate(10deg);
    }
    100% {
        opacity: 0;
        transform: translate(-50%, -150vh) scale(0.8) rotate(45deg);
    }
}

.envelope.flying {
    animation: flyUp 1.5s cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .scroll-nav-section {
        flex-direction: column;
        align-items: center;
    }
    
    .scroll-nav-btn {
        max-width: 100%;
        width: 100%;
    }
    
    .likes-section .likes-btn {
        max-width: 100%;
    }
    
    /* Message Cards Responsive */
    .message-cards {
        grid-template-columns: 1fr;
    }

    .card-emoji {
        font-size: 1.2rem;
    }

    .card-message {
        font-size: 0.85rem;
    }

    .send-count {
        font-size: 0.75rem;
    }

    .send-btn {
        padding: 5px 12px;
        font-size: 0.8rem;
    }
}

@media (max-width: 480px) {
    .card-content {
        gap: 8px;
    }

    .card-left {
        gap: 8px;
    }

    .card-message {
        font-size: 0.8rem;
    }
}

/* Period Tabs Styling */
.period-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.period-tabs .tab {
    padding: 8px 16px;
    border: 1px solid #e0e0e0;
    background: white;
    border-radius: 20px;
    cursor: pointer;
    font-size: 13px;
    transition: all 0.2s;
    color: var(--text-primary);
    font-weight: 500;
}

.period-tabs .tab:hover {
    background: #f8f9fa;
}

.period-tabs .tab.active {
    background: #3498db;
    color: white;
    border-color: #3498db;
}

/* Category Chart Styling */
.category-chart {
    margin-bottom: var(--spacing-xl);
    padding: var(--spacing-md);
    background-color: var(--bg-primary);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-sm);
    position: relative;
    min-height: 300px;
}

.category-chart canvas {
    max-height: 400px;
}

.category-chart canvas[style*="display: none"] {
    display: none !important;
    height: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
}

.category-chart > div {
    min-height: 300px;
}

.category-chart > div[style*="display: none"] {
    display: none !important;
    height: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
}

/* Mobile Responsive for Tabs */
@media (max-width: 768px) {
    .period-tabs {
        gap: 5px;
    }
    
    .period-tabs .tab {
        padding: 6px 12px;
        font-size: 12px;
        flex: 1;
        min-width: 55px;
    }
    
    .stats-boxes {
        gap: 8px;
    }
    
    .stat-box {
        padding: 8px 12px;
        min-height: 50px;
    }
    
    .stat-label {
        font-size: 0.65rem;
    }
    
    .stat-value {
        font-size: 1rem;
    }
}

/* =========================================
   HUD DASHBOARD THEME (Dark Glassmorphism)
   Matches Index.html Tone & Manner
   ========================================= */

:root {
    --hud-bg: #0f172a;
    --hud-card-bg: rgba(255, 255, 255, 0.05);
    --hud-card-border: rgba(255, 255, 255, 0.1);
    --hud-text-main: #ffffff;
    --hud-text-sub: rgba(255, 255, 255, 0.6);
    --hud-primary: #667eea;
    --hud-secondary: #764ba2;
    --hud-accent: #4ecdc4;
}

.hud-body {
    background: radial-gradient(circle at top, #1e293b 0%, #0f172a 100%);
    color: var(--hud-text-main);
    font-family: 'GmarketSans', sans-serif;
    min-height: 100vh;
}

/* --- Container & Layout --- */
.hud-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 80px 20px 40px; /* Top padding for fixed navbar */
}

/* --- Search Header --- */
.hud-header {
    margin-bottom: 30px;
    display: flex;
    justify-content: center;
}

.hud-search-form {
    width: 100%;
    max-width: 500px;
}

.search-wrapper {
    position: relative;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border: 1px solid var(--hud-card-border);
    border-radius: 50px;
    padding: 5px;
    display: flex;
}

.search-wrapper input {
    flex: 1;
    background: transparent;
    border: none;
    color: white;
    padding: 12px 20px;
    font-size: 1rem;
    outline: none;
}

.search-wrapper input::placeholder {
    color: rgba(255, 255, 255, 0.4);
}

.search-wrapper button {
    background: linear-gradient(135deg, var(--hud-primary), var(--hud-secondary));
    border: none;
    border-radius: 50%;
    width: 44px;
    height: 44px;
    color: white;
    font-size: 1.2rem;
    cursor: pointer;
    transition: transform 0.2s;
}

.search-wrapper button:hover {
    transform: scale(1.1);
}

/* --- Main Grid System --- */
.hud-grid {
    display: grid;
    grid-template-columns: 350px 1fr;
    gap: 20px;
    margin-bottom: 40px;
}

@media (max-width: 900px) {
    .hud-grid {
        grid-template-columns: 1fr;
    }
}

/* --- Card Styles (Glassmorphism) --- */
.hud-card {
    background: var(--hud-card-bg);
    backdrop-filter: blur(12px);
    border: 1px solid var(--hud-card-border);
    border-radius: 20px;
    padding: 24px;
    position: relative;
    overflow: hidden;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

/* --- Plate Hero Card --- */
.plate-hero-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    background: linear-gradient(180deg, rgba(255,255,255,0.08) 0%, rgba(255,255,255,0.02) 100%);
}

.plate-status-badge {
    background: rgba(78, 205, 196, 0.2);
    color: #4ecdc4;
    border: 1px solid rgba(78, 205, 196, 0.4);
    font-size: 0.7rem;
    padding: 4px 10px;
    border-radius: 12px;
    margin-bottom: 15px;
    letter-spacing: 1px;
    animation: pulseBadge 2s infinite;
}

@keyframes pulseBadge {
    0% { box-shadow: 0 0 0 0 rgba(78, 205, 196, 0.4); }
    70% { box-shadow: 0 0 0 10px rgba(78, 205, 196, 0); }
    100% { box-shadow: 0 0 0 0 rgba(78, 205, 196, 0); }
}

.hud-plate-number {
    font-size: 2.5rem;
    font-weight: 700;
    margin: 0 0 20px 0;
    text-shadow: 0 0 20px rgba(255, 255, 255, 0.3);
    letter-spacing: 2px;
}

.plate-interactions {
    display: flex;
    gap: 20px;
    margin-bottom: 30px;
}

.hud-btn-icon {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.hud-btn-icon:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-3px);
}

.plate-interactions .label {
    display: block;
    font-size: 0.7rem;
    color: var(--hud-text-sub);
    margin-top: 5px;
    text-align: center;
}

.hud-stats-row {
    display: flex;
    justify-content: space-around;
    width: 100%;
    padding-top: 20px;
    border-top: 1px solid var(--hud-card-border);
}

.hud-stat {
    display: flex;
    flex-direction: column;
}

.hud-stat .value {
    font-size: 1.2rem;
    font-weight: 700;
    color: white;
}

.hud-stat .label {
    font-size: 0.75rem;
    color: var(--hud-text-sub);
    text-transform: uppercase;
}

/* --- Chart Card (Bars) --- */
.chart-card {
    margin-top: 20px;
    height: 200px;
    display: flex;
    flex-direction: column;
}

.card-title h3 {
    font-size: 0.9rem;
    color: var(--hud-text-sub);
    margin-bottom: 15px;
    font-weight: 500;
}

.chart-bars-container {
    flex: 1;
    display: flex;
    align-items: flex-end;
    gap: 8px;
    padding-bottom: 20px;
}

.hud-bar {
    flex: 1;
    background: linear-gradient(to top, rgba(102, 126, 234, 0.3), rgba(102, 126, 234, 0.8));
    border-radius: 4px 4px 0 0;
    position: relative;
    transition: height 0.5s ease;
    min-height: 4px;
}

.hud-bar:hover {
    background: #667eea;
    box-shadow: 0 0 10px #667eea;
}

.hud-bar span {
    position: absolute;
    bottom: -25px;
    width: 100%;
    text-align: center;
    font-size: 0.7rem;
    color: var(--hud-text-sub);
}

/* --- Action Cards (Right Column) --- */
.hud-actions-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 20px;
}

.hud-action-card {
    border: none;
    border-radius: 20px;
    padding: 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    text-align: left;
    color: white;
    position: relative;
    overflow: hidden;
}

/* Matching Gradients from Index.html */
.gradient-warning {
    background: linear-gradient(135deg, #ff6b6b 0%, #ee5a6f 100%);
    box-shadow: 0 4px 15px rgba(238, 90, 111, 0.3);
}

.gradient-success {
    background: linear-gradient(135deg, #4ecdc4 0%, #44a08d 100%);
    box-shadow: 0 4px 15px rgba(68, 160, 141, 0.3);
}

.hud-action-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.4);
}

.hud-action-card .icon {
    font-size: 2rem;
    margin-right: 15px;
}

.hud-action-card .text h4 {
    font-size: 1.1rem;
    margin-bottom: 4px;
    font-weight: 700;
}

.hud-action-card .text p {
    font-size: 0.8rem;
    opacity: 0.9;
    margin: 0;
}

.hud-action-card .arrow {
    font-size: 1.5rem;
    opacity: 0.6;
}

/* --- Analysis Panel --- */
.analysis-panel {
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.panel-header {
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.analysis-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
}

.mini-chart-box {
    background: rgba(255, 255, 255, 0.03);
    border-radius: 15px;
    padding: 15px;
}

.box-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.box-header h4 {
    font-size: 0.9rem;
    color: #fff;
    font-weight: 500;
}

.period-toggle {
    background: rgba(0,0,0,0.3);
    border-radius: 10px;
    padding: 2px;
    display: flex;
}

.toggle-item {
    font-size: 0.7rem;
    padding: 2px 8px;
    border-radius: 8px;
    cursor: pointer;
    color: var(--hud-text-sub);
    transition: all 0.2s;
}

/* script.js expects 'active' class on tabs */
.toggle-item.active {
    background: rgba(255, 255, 255, 0.2);
    color: white;
}

.canvas-wrapper {
    height: 120px;
    position: relative;
}

/* --- Message Sending Section --- */
.hud-section {
    padding-top: 40px;
}

.section-header {
    font-size: 1.5rem;
    color: white;
    margin-bottom: 30px;
    border-left: 5px solid var(--hud-primary);
    padding-left: 15px;
}

.msg-group {
    margin-bottom: 40px;
}

.group-title {
    font-size: 1rem;
    font-weight: 700;
    margin-bottom: 15px;
    padding: 8px 15px;
    border-radius: 8px;
    display: inline-block;
}

.group-title.danger { background: rgba(239, 68, 68, 0.2); color: #fca5a5; }
.group-title.warning { background: rgba(245, 158, 11, 0.2); color: #fcd34d; }
.group-title.info { background: rgba(59, 130, 246, 0.2); color: #93c5fd; }
.group-title.success { background: rgba(16, 185, 129, 0.2); color: #6ee7b7; }

.msg-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 15px;
}

.msg-btn {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 15px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    transition: all 0.2s;
    position: relative;
    overflow: hidden;
}

.msg-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: translateY(-3px);
    border-color: rgba(255, 255, 255, 0.3);
}

.msg-btn:active {
    transform: scale(0.98);
}

.msg-btn .emoji {
    font-size: 2rem;
}

.msg-btn .text {
    font-size: 0.9rem;
    font-weight: 500;
    color: white;
}

.msg-btn .count {
    font-size: 0.8rem;
    color: var(--hud-text-sub);
    background: rgba(0,0,0,0.3);
    padding: 2px 8px;
    border-radius: 10px;
}

/* --- Footer --- */
.hud-footer {
    margin-top: 60px;
    text-align: center;
    color: var(--hud-text-sub);
    font-size: 0.8rem;
    border-top: 1px solid rgba(255,255,255,0.05);
    padding-top: 20px;
}

.hud-footer .links a {
    color: var(--hud-text-sub);
    margin: 0 10px;
    text-decoration: none;
}

.hud-footer .links a:hover {
    color: white;
}

/* --- Chart.js Overrides for Dark Mode --- */
/* These make sure charts are visible against dark bg */
canvas {
    filter: brightness(1.1);
}

@media (max-width: 600px) {
    .hud-actions-grid {
        grid-template-columns: 1fr;
    }
    .msg-grid {
        grid-template-columns: 1fr 1fr;
    }
}
/*
 ============================================
   SUBSCRIBE BUTTON & POPUP STYLES
   ============================================ */

/* Subscribe Button */
.pro-btn-subscribe {
    background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
    color: white;
    border-color: #2563eb;
    transition: all 0.3s ease;
}

.pro-btn-subscribe:hover {
    background: linear-gradient(135deg, #1d4ed8 0%, #1e40af 100%);
    border-color: #1d4ed8;
    transform: translateY(-2px) scale(1.05);
}

.pro-btn-subscribe:active {
    transform: translateY(0) scale(0.98);
}

/* Subscribe Popup */
.subscribe-popup {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.3s ease;
}

.subscribe-popup-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
}

.subscribe-popup-content {
    position: relative;
    background: white;
    border-radius: 16px;
    padding: 32px 24px;
    max-width: 420px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: slideUp 0.3s ease;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.subscribe-popup-close {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 32px;
    height: 32px;
    border: none;
    background: #f3f4f6;
    border-radius: 50%;
    font-size: 20px;
    color: #6b7280;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.subscribe-popup-close:hover {
    background: #e5e7eb;
    color: #1f2937;
    transform: rotate(90deg);
}

.subscribe-popup-content h3 {
    font-size: 1.5rem;
    font-weight: 700;
    color: #1f2937;
    margin-bottom: 12px;
    text-align: center;
}

.subscribe-popup-desc {
    font-size: 0.875rem;
    color: #6b7280;
    text-align: center;
    margin-bottom: 24px;
    line-height: 1.6;
}

.subscribe-install-btn {
    width: 100%;
    padding: 16px 24px;
    font-size: 1rem;
    font-weight: 600;
    color: white;
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    border: none;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(16, 185, 129, 0.3);
    margin-bottom: 16px;
}

.subscribe-install-btn:hover {
    background: linear-gradient(135deg, #059669 0%, #047857 100%);
    box-shadow: 0 6px 20px rgba(16, 185, 129, 0.4);
    transform: translateY(-2px);
}

.subscribe-install-btn:active {
    transform: translateY(0);
}

.subscribe-consent {
    background: #fef3c7;
    border: 1px solid #fcd34d;
    border-radius: 8px;
    padding: 12px;
    margin-bottom: 24px;
}

.subscribe-consent small {
    font-size: 0.75rem;
    color: #92400e;
    line-height: 1.5;
    display: block;
}

.subscribe-list-section {
    border-top: 2px solid #e5e7eb;
    padding-top: 20px;
}

.subscribe-list-section h4 {
    font-size: 1rem;
    font-weight: 600;
    color: #1f2937;
    margin-bottom: 16px;
}

.subscribe-list-section h4 span {
    color: #2563eb;
}

.subscribed-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.no-subscriptions {
    text-align: center;
    color: #9ca3af;
    font-size: 0.875rem;
    padding: 24px;
}

.subscribed-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    transition: all 0.2s ease;
}

.subscribed-item:hover {
    background: #f3f4f6;
    border-color: #d1d5db;
}

.subscribed-item-plate {
    font-size: 1rem;
    font-weight: 600;
    color: #1f2937;
    letter-spacing: 0.5px;
}

.subscribed-item-cancel {
    padding: 6px 12px;
    font-size: 0.75rem;
    font-weight: 600;
    color: white;
    background: #ef4444;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.subscribed-item-cancel:hover {
    background: #dc2626;
    transform: scale(1.05);
}

.subscribed-item-cancel:active {
    transform: scale(0.95);
}

/* Dark mode support for popup */
[data-theme="dark"] .subscribe-popup-content {
    background: #1f2937;
    color: #f9fafb;
}

[data-theme="dark"] .subscribe-popup-content h3 {
    color: #f9fafb;
}

[data-theme="dark"] .subscribe-popup-desc {
    color: #9ca3af;
}

[data-theme="dark"] .subscribe-popup-close {
    background: #374151;
    color: #9ca3af;
}

[data-theme="dark"] .subscribe-popup-close:hover {
    background: #4b5563;
    color: #f9fafb;
}

[data-theme="dark"] .subscribe-list-section {
    border-top-color: #374151;
}

[data-theme="dark"] .subscribe-list-section h4 {
    color: #f9fafb;
}

[data-theme="dark"] .subscribed-item {
    background: #374151;
    border-color: #4b5563;
}

[data-theme="dark"] .subscribed-item:hover {
    background: #4b5563;
    border-color: #6b7280;
}

[data-theme="dark"] .subscribed-item-plate {
    color: #f9fafb;
}

/* Mobile responsive */
@media (max-width: 767px) {
    .subscribe-popup-content {
        padding: 24px 20px;
        max-height: 90vh;
    }
    
    .subscribe-popup-content h3 {
        font-size: 1.25rem;
    }
    
    .subscribe-install-btn {
        padding: 14px 20px;
        font-size: 0.9375rem;
    }
}

/* ============================================================================
   Voice Input Modal - Mobile Bottom Sheet
   ============================================================================ */
.voice-modal {
    display: none !important;
    position: fixed;
    inset: 0;
    z-index: 9999;
    font-family: 'GmarketSans', sans-serif;
    visibility: hidden;
    opacity: 0;
    pointer-events: none;
}

.voice-modal.active {
    display: flex !important;
    visibility: visible;
    opacity: 1;
    pointer-events: auto;
}

.voice-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
}

.voice-sheet {
    position: relative;
    width: 100%;
    max-width: 500px;
    margin: auto auto 0;
    background: white;
    border-radius: 24px 24px 0 0;
    padding: 32px 24px 40px;
    text-align: center;
    animation: slideUp 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.voice-handle {
    width: 40px;
    height: 4px;
    background: #e0e0e0;
    border-radius: 2px;
    margin: 0 auto 20px;
}

.voice-text {
    font-size: 18px;
    font-weight: 500;
    color: #1f2328;
    margin-bottom: 24px;
    line-height: 1.5;
}

.voice-text small {
    font-size: 14px;
    font-weight: normal;
}

#voiceListeningText {
    font-size: 20px;
    font-weight: 700;
    color: #ef4444;
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid #e0e0e0;
}

.animated-dots::after {
    content: '';
    animation: dots 1.5s steps(4) infinite;
}

@keyframes dots {
    0%, 20% { content: ''; }
    40% { content: '.'; }
    60% { content: '..'; }
    80%, 100% { content: '...'; }
}

.voice-cancel-btn {
    margin-top: 32px;
    padding: 12px 32px;
    font-size: 16px;
    font-weight: 600;
    color: #ef4444;
    background: transparent;
    border: 2px solid #ef4444;
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.voice-cancel-btn:hover {
    background: #ef4444;
    color: white;
}

@keyframes slideUp {
    from { transform: translateY(100%); }
    to { transform: translateY(0); }
}

/* Dark mode support */
[data-theme="dark"] .voice-sheet {
    background: #161b22;
    color: #c9d1d9;
}

[data-theme="dark"] .voice-handle {
    background: #30363d;
}

[data-theme="dark"] .voice-text {
    color: #c9d1d9;
}

[data-theme="dark"] #voiceListeningText {
    border-top-color: #30363d;
}

/* Voice Candidates */
.voice-candidates {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin: 20px 0;
    padding: 0 20px;
}

.voice-candidate {
    padding: 16px 20px;
    background: #f8fafc;
    border: 2px solid #e2e8f0;
    border-radius: 16px;
    font-size: 20px;
    font-weight: 700;
    letter-spacing: 4px;
    color: #1e293b;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
    position: relative;
}

.voice-candidate:hover {
    background: #e0f2fe;
    border-color: #0ea5e9;
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0,0,0,0.12);
}

.voice-candidate:active {
    transform: translateY(0);
}

/* Removed .voice-candidate.best styling - all candidates equal */

/* Dark mode candidates */
[data-theme="dark"] .voice-candidate {
    background: #1e293b;
    border-color: #334155;
    color: #f1f5f9;
}

[data-theme="dark"] .voice-candidate:hover {
    background: #334155;
    border-color: #60a5fa;
}

/* Removed [data-theme="dark"] .voice-candidate.best - all candidates equal */

[data-theme="dark"] .voice-cancel-btn {
    color: #f87171;
    border-color: #f87171;
}

[data-theme="dark"] .voice-cancel-btn:hover {
    background: #f87171;
    color: #161b22;
}

/* Voice Mic Button */
.voice-mic-btn {
    position: absolute;
    right: 120px;
    top: 50%;
    transform: translateY(-50%);
    background: #3b82f6;
    border: none;
    color: white;
    cursor: pointer;
    z-index: 10;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(59, 130, 246, 0.3);
}

.voice-mic-btn:hover {
    background: #2563eb;
    transform: translateY(-50%) scale(1.05);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.4);
}

.voice-mic-btn svg {
    color: white;
}

.voice-mic-btn.dark {
    background: #3b82f6;
    color: white;
}

.voice-mic-btn.dark:hover {
    background: #2563eb;
}

/* Adjust for plate.html navbar search */
.pro-search-form {
    position: relative;
}

.pro-search-form .voice-mic-btn {
    right: 100px;
}

.pro-search-input {
    padding-right: 150px !important;
}

/* Mobile adjustments */
@media (max-width: 767px) {
    .voice-sheet {
        padding: 24px 20px 32px;
    }
    
    .voice-text {
        font-size: 16px;
    }
    
    #voiceListeningText {
        font-size: 18px;
    }
    
    .voice-cancel-btn {
        padding: 10px 28px;
        font-size: 14px;
    }
    
    .voice-mic-btn {
        right: 110px;
        width: 36px;
        height: 36px;
    }
    
    .voice-mic-btn svg {
        width: 18px;
        height: 18px;
    }
    
    .pro-search-form .voice-mic-btn {
        right: 90px;
    }
    
    .search-input {
        padding-right: 160px !important;
        font-size: 16px !important;
    }
    
    .search-input::placeholder {
        font-size: 14px !important;
    }
}

/* Extra small screens */
@media (max-width: 375px) {
    .voice-mic-btn {
        right: 100px;
        width: 32px;
        height: 32px;
    }
    
    .voice-mic-btn svg {
        width: 16px;
        height: 16px;
    }
    
    .pro-search-form .voice-mic-btn {
        right: 80px;
    }
    
    .search-input {
        padding-right: 140px !important;
    }
}
