/* ==========================================================================
   NAKTS AUTOFOTOORIENTĒŠANĀS BRAUCIENA MIKRO-APTAUJA - STILU FAILS
   Aestētiķa tumšā tēma (Dark Theme + Glassmorphism + Mobile First)
   ========================================================================== */

:root {
    /* Krāsu palete */
    --bg-main: #0a0e17;
    --bg-card: rgba(18, 26, 43, 0.85);
    --bg-card-hover: rgba(26, 38, 62, 0.95);
    --bg-input: rgba(10, 16, 28, 0.7);
    --border-color: rgba(255, 255, 255, 0.1);
    --border-focus: #38bdf8;
    
    /* Teksta krāsas */
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    
    /* Akcentu krāsas */
    --accent-gold: #fbbf24;
    --accent-gold-hover: #f59e0b;
    --accent-gold-glow: rgba(251, 191, 36, 0.3);
    --accent-blue: #38bdf8;
    --accent-blue-hover: #0284c7;
    
    /* Statusu krāsas */
    --color-success: #10b981;
    --color-error: #ef4444;
    --color-warning: #f59e0b;
    
    /* Zvaigžņu sadalījuma krāsas */
    --star-5: #10b981;
    --star-4: #84cc16;
    --star-3: #eab308;
    --star-2: #f97316;
    --star-1: #ef4444;

    /* Izmēri un atstarpes */
    --radius-sm: 8px;
    --radius-md: 14px;
    --radius-lg: 20px;
    --transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    --shadow-main: 0 10px 30px -5px rgba(0, 0, 0, 0.5), 0 0 20px rgba(56, 189, 248, 0.05);
}

/* Bāzes iestatījumi */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
    -webkit-tap-highlight-color: transparent;
}

body {
    font-family: 'Outfit', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background-color: var(--bg-main);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    position: relative;
    overflow-x: hidden;
}

/* Fona spīduma (Glow) efekti */
.bg-glow {
    position: fixed;
    width: 350px;
    height: 350px;
    border-radius: 50%;
    filter: blur(120px);
    z-index: 0;
    pointer-events: none;
    opacity: 0.4;
}

.bg-glow-1 {
    top: -100px;
    right: -100px;
    background: radial-gradient(circle, #0284c7 0%, transparent 70%);
}

.bg-glow-2 {
    bottom: -100px;
    left: -100px;
    background: radial-gradient(circle, #7c3aed 0%, transparent 70%);
}

/* Korpusa konteiners */
.container {
    width: 100%;
    max-width: 680px;
    margin: 0 auto;
    padding: 2rem 1.25rem;
    position: relative;
    z-index: 1;
}

.admin-container {
    max-width: 1100px;
}

.login-container {
    max-width: 440px;
    margin-top: auto;
    margin-bottom: auto;
}

/* Glāzmorfisma Kartiņa */
.card {
    background: var(--bg-card);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 2rem;
    box-shadow: var(--shadow-main);
    transition: var(--transition);
}

/* Galvenes stils */
.header {
    text-align: center;
    margin-bottom: 2rem;
}

.brand-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: rgba(56, 189, 248, 0.1);
    color: var(--accent-blue);
    border: 1px solid rgba(56, 189, 248, 0.25);
    padding: 0.35rem 1rem;
    border-radius: 50px;
    font-size: 0.875rem;
    font-weight: 600;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    margin-bottom: 1.25rem;
}

.pulse-dot {
    width: 8px;
    height: 8px;
    background-color: var(--accent-blue);
    border-radius: 50%;
    box-shadow: 0 0 10px var(--accent-blue);
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(56, 189, 248, 0.7); }
    70% { transform: scale(1); box-shadow: 0 0 0 8px rgba(56, 189, 248, 0); }
    100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(56, 189, 248, 0); }
}

.title {
    font-size: 2rem;
    font-weight: 700;
    line-height: 1.25;
    margin-bottom: 0.75rem;
    background: linear-gradient(135deg, #ffffff 0%, #cbd5e1 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.subtitle {
    color: var(--text-secondary);
    font-size: 1.05rem;
    max-width: 540px;
    margin: 0 auto;
}

/* Formas Elementi */
.form-group {
    margin-bottom: 1.75rem;
}

.form-label {
    display: block;
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.required-star {
    color: var(--accent-gold);
}

.optional-badge {
    font-size: 0.85rem;
    font-weight: 400;
    color: var(--text-muted);
    margin-left: 0.25rem;
}

.field-hint {
    font-size: 0.875rem;
    color: var(--text-muted);
    margin-top: -0.25rem;
    margin-bottom: 1rem;
}

/* Slēptais Honeypot lauks botu apturēšanai */
.hp-field {
    display: none !important;
    position: absolute;
    left: -9999px;
}

/* 1. ZVAIGŽŅU VĒRTĒŠANAS SAS KARNE (CSS INTERAKTIVITĀTE) */
.star-rating-group {
    text-align: center;
    background: rgba(10, 16, 28, 0.5);
    padding: 1.5rem 1rem;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
}

.star-rating {
    display: inline-flex;
    flex-direction: row-reverse;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
    margin: 0.75rem 0;
}

.star-rating input[type="radio"] {
    display: none;
}

.star-rating label {
    cursor: pointer;
    padding: 0.25rem;
    transition: var(--transition);
    touch-action: manipulation;
}

.star-icon {
    width: 44px;
    height: 44px;
    fill: rgba(255, 255, 255, 0.15);
    stroke: rgba(255, 255, 255, 0.25);
    stroke-width: 1px;
    transition: var(--transition);
}

/* Interaktīvā Zvaigžņu Iezīmēšana (Hover & Active) */
.star-rating label:hover .star-icon,
.star-rating label:hover ~ label .star-icon,
.star-rating input[type="radio"]:checked ~ label .star-icon {
    fill: var(--accent-gold);
    stroke: var(--accent-gold-hover);
    filter: drop-shadow(0 0 10px var(--accent-gold-glow));
    transform: scale(1.12);
}

.star-rating label:active .star-icon {
    transform: scale(0.95);
}

.rating-text-feedback {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--accent-gold);
    min-height: 1.75rem;
    margin-top: 0.5rem;
    transition: var(--transition);
}

/* Formas Teksta Lauki */
.form-control {
    width: 100%;
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 0.85rem 1.1rem;
    font-family: inherit;
    font-size: 1rem;
    color: var(--text-primary);
    transition: var(--transition);
}

.form-control::placeholder {
    color: var(--text-muted);
}

.form-control:focus {
    outline: none;
    border-color: var(--border-focus);
    box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.25);
    background: rgba(15, 23, 42, 0.9);
}

.textarea-control {
    resize: vertical;
    min-height: 110px;
}

.char-count {
    font-size: 0.8rem;
    color: var(--text-muted);
    text-align: right;
    margin-top: 0.35rem;
}

/* Pogas */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.9rem 1.75rem;
    font-family: inherit;
    font-size: 1rem;
    font-weight: 600;
    border-radius: var(--radius-sm);
    border: none;
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
    touch-action: manipulation;
}

.btn-primary {
    width: 100%;
    background: linear-gradient(135deg, var(--accent-blue) 0%, var(--accent-blue-hover) 100%);
    color: #0b0f19;
    box-shadow: 0 4px 15px rgba(56, 189, 248, 0.3);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(56, 189, 248, 0.45);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.18);
}

.btn-outline {
    background: transparent;
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
}

.btn-outline:hover {
    color: var(--text-primary);
    border-color: var(--text-secondary);
}

.btn-accent {
    background: linear-gradient(135deg, var(--accent-gold) 0%, var(--accent-gold-hover) 100%);
    color: #0b0f19;
}

.btn-accent:hover {
    box-shadow: 0 4px 15px var(--accent-gold-glow);
}

.btn-danger {
    background: rgba(239, 68, 68, 0.15);
    color: var(--color-error);
    border: 1px solid rgba(239, 68, 68, 0.3);
}

.btn-danger:hover {
    background: rgba(239, 68, 68, 0.3);
}

.btn-sm {
    padding: 0.45rem 0.85rem;
    font-size: 0.875rem;
}

.btn-full {
    width: 100%;
}

.btn-icon {
    background: none;
    border: none;
    font-size: 1.1rem;
    cursor: pointer;
    padding: 0.25rem 0.5rem;
    border-radius: var(--radius-sm);
    transition: var(--transition);
}

.btn-delete:hover {
    background: rgba(239, 68, 68, 0.2);
}

/* Spinner animācija pogās */
.btn-spinner {
    width: 18px;
    height: 18px;
    border: 2.5px solid rgba(11, 15, 25, 0.3);
    border-top-color: #0b0f19;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Paziņojumi (Alerts) */
.alert {
    padding: 0.85rem 1.1rem;
    border-radius: var(--radius-sm);
    font-size: 0.95rem;
    margin-bottom: 1.25rem;
}

.alert-error {
    background: rgba(239, 68, 68, 0.15);
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: #fca5a5;
}

.alert-success {
    background: rgba(16, 185, 129, 0.15);
    border: 1px solid rgba(16, 185, 129, 0.3);
    color: #6ee7b7;
}

.error-message {
    color: #fca5a5;
    font-size: 0.875rem;
    margin-top: 0.5rem;
    display: none;
}

.error-message.active {
    display: block;
}

/* Paldies Kartiņa */
.thank-you-card {
    text-align: center;
    padding: 3rem 2rem;
    animation: fadeIn 0.5s ease-out forwards;
}

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

.thank-you-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 80px;
    height: 80px;
    background: rgba(16, 185, 129, 0.15);
    color: var(--color-success);
    border-radius: 50%;
    margin-bottom: 1.5rem;
    border: 2px solid rgba(16, 185, 129, 0.4);
}

.thank-you-card h2 {
    font-size: 1.75rem;
    margin-bottom: 0.75rem;
}

.thank-you-card p {
    color: var(--text-secondary);
    max-width: 480px;
    margin: 0 auto 2rem auto;
}

/* Kājene */
.footer {
    text-align: center;
    margin-top: auto;
    padding-top: 2rem;
    color: var(--text-muted);
    font-size: 0.85rem;
}

/* ==========================================================================
   ADMINISTRĀCIJA (ADMIN PANEL STYLES)
   ========================================================================== */

.admin-header {
    background: rgba(18, 26, 43, 0.95);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 100;
    padding: 1rem 0;
}

.admin-header-container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 1.25rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.admin-actions {
    display: flex;
    gap: 0.75rem;
}

/* Statistika Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1.25rem;
    margin-bottom: 1.5rem;
}

.stat-card {
    display: flex;
    flex-direction: column;
    padding: 1.5rem;
}

.stat-label {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 0.5rem;
}

.stat-value {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1;
    margin-bottom: 0.5rem;
}

.stat-max {
    font-size: 1.2rem;
    color: var(--text-muted);
    font-weight: 400;
}

.stat-subtext {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.stars-display {
    color: var(--accent-gold);
    font-size: 1.4rem;
    letter-spacing: 2px;
}

/* Zvaigžņu sadalījuma joslas */
.distribution-card {
    grid-column: span 1;
}

@media (min-width: 900px) {
    .distribution-card {
        grid-column: span 2;
    }
}

.dist-bars {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-top: 0.25rem;
}

.dist-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 0.875rem;
}

.dist-stars {
    width: 38px;
    color: var(--accent-gold);
    font-weight: 600;
}

.dist-bar-track {
    flex: 1;
    height: 10px;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 5px;
    overflow: hidden;
}

.dist-bar-fill {
    height: 100%;
    border-radius: 5px;
    transition: width 0.6s ease-out;
}

.dist-bar-5 { background-color: var(--star-5); }
.dist-bar-4 { background-color: var(--star-4); }
.dist-bar-3 { background-color: var(--star-3); }
.dist-bar-2 { background-color: var(--star-2); }
.dist-bar-1 { background-color: var(--star-1); }

.dist-count {
    width: 70px;
    text-align: right;
    color: var(--text-secondary);
}

/* Rīkjosla & Filtri */
.controls-card {
    padding: 1.25rem;
    margin-bottom: 1.5rem;
}

.controls-form {
    display: flex;
    flex-wrap: wrap;
    gap: 0.85rem;
    align-items: center;
}

.control-group {
    flex: 1;
    min-width: 180px;
}

.search-group {
    flex: 2;
    min-width: 240px;
}

.control-buttons {
    display: flex;
    gap: 0.5rem;
    margin-left: auto;
}

/* Tabula */
.table-card {
    padding: 0;
    overflow: hidden;
}

.table-header {
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--border-color);
}

.table-responsive {
    width: 100%;
    overflow-x: auto;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
}

.data-table th, .data-table td {
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--border-color);
    font-size: 0.95rem;
}

.data-table th {
    background: rgba(10, 16, 28, 0.4);
    color: var(--text-muted);
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.8rem;
    letter-spacing: 0.5px;
}

.data-table tbody tr:hover {
    background: rgba(255, 255, 255, 0.03);
}

.nowrap {
    white-space: nowrap;
}

.comment-cell {
    max-width: 350px;
    word-break: break-word;
}

.ip-cell code {
    background: rgba(255, 255, 255, 0.08);
    padding: 0.2rem 0.4rem;
    border-radius: 4px;
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.star-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.25rem 0.6rem;
    border-radius: 50px;
    font-weight: 700;
    font-size: 0.85rem;
}

.star-badge-5 { background: rgba(16, 185, 129, 0.2); color: #34d399; }
.star-badge-4 { background: rgba(132, 204, 22, 0.2); color: #a3e635; }
.star-badge-3 { background: rgba(234, 179, 8, 0.2); color: #fde047; }
.star-badge-2 { background: rgba(249, 115, 22, 0.2); color: #fb923c; }
.star-badge-1 { background: rgba(239, 68, 68, 0.2); color: #fca5a5; }

.empty-state {
    padding: 3rem 1.5rem;
    text-align: center;
    color: var(--text-muted);
}

.inline-form {
    display: inline;
}

/* Responsīvā vide: Mobilie ekrāni (Mobile Cards vs Table) */
.mobile-only {
    display: none;
}

@media (max-width: 768px) {
    .desktop-only {
        display: none !important;
    }
    .mobile-only {
        display: block !important;
    }
    
    .container {
        padding: 1.25rem 0.85rem;
    }
    
    .title {
        font-size: 1.5rem;
    }

    .card {
        padding: 1.35rem;
        border-radius: var(--radius-md);
    }
    
    .star-icon {
        width: 38px;
        height: 38px;
    }

    .control-buttons {
        width: 100%;
        justify-content: space-between;
        margin-top: 0.5rem;
    }

    .mobile-cards {
        display: flex;
        flex-direction: column;
        gap: 1rem;
        padding: 1rem;
    }

    .mobile-card {
        background: rgba(10, 16, 28, 0.6);
        border: 1px solid var(--border-color);
        border-radius: var(--radius-md);
        padding: 1rem;
    }

    .mobile-card-header {
        display: flex;
        justify-content: space-between;
        align-items: center;
        margin-bottom: 0.75rem;
        padding-bottom: 0.5rem;
        border-bottom: 1px solid var(--border-color);
    }

    .mobile-field {
        margin-bottom: 0.5rem;
    }

    .field-label {
        font-size: 0.8rem;
        color: var(--text-muted);
        display: block;
    }

    .mobile-comment {
        font-size: 0.95rem;
        color: var(--text-primary);
        background: rgba(255, 255, 255, 0.03);
        padding: 0.5rem 0.75rem;
        border-radius: var(--radius-sm);
        margin-top: 0.25rem;
    }

    .mobile-card-footer {
        display: flex;
        justify-content: space-between;
        align-items: center;
        margin-top: 0.75rem;
        padding-top: 0.5rem;
        border-top: 1px solid var(--border-color);
        font-size: 0.8rem;
    }
}
