@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=Outfit:wght@400;500;600;700;800&display=swap');

:root {
    --bg-dark: #0b0f19;
    --bg-card: #151c2c;
    --bg-card-hover: #1e293b;
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --accent: #10b981; 
    --accent-glow: rgba(16, 185, 129, 0.15);
    --warning: #f59e0b; 
    --danger: #ef4444; 
    --border-color: #243249;
    
    --border-radius-lg: 16px;
    --border-radius-md: 10px;
    --border-radius-sm: 6px;
    --transition-smooth: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

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

body {
    background-color: var(--bg-dark);
    color: var(--text-primary);
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    min-height: 100vh;
    line-height: 1.5;
}

/* -------------------------------------------------------------
   📱 MOBILE LAYOUT STYLES (index.html 전용)
   ------------------------------------------------------------- */
.mobile-body-theme {
    background-color: #0d1117;
    display: flex;
    justify-content: center;
    align-items: flex-start;
}

.mobile-container {
    width: 100%;
    max-width: 480px;
    min-height: 100vh;
    background: #0d1117;
    border-left: 1px solid var(--border-color);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    position: relative;
}

.mobile-header {
    padding: 1.2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--border-color);
    background: rgba(13, 17, 23, 0.95);
    backdrop-filter: blur(8px);
    position: sticky;
    top: 0;
    z-index: 10;
}

.mobile-title {
    font-family: 'Outfit', sans-serif;
    font-size: 1.2rem;
    font-weight: 700;
    background: linear-gradient(135deg, #10b981 0%, #3b82f6 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.mobile-content-body {
    padding: 1.2rem;
    padding-bottom: 70px; /* footer tab navigation buffer */
    flex: 1;
    display: flex;
    flex-direction: column;
}

.mobile-session-info {
    font-size: 0.8rem;
    color: var(--accent);
    background: rgba(16, 185, 129, 0.08);
    padding: 10px 14px;
    border-radius: var(--border-radius-md);
    border: 1px solid var(--accent-glow);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.mobile-tabs {
    position: fixed;
    bottom: 0;
    width: 100%;
    max-width: 480px;
    height: calc(60px + env(safe-area-inset-bottom));
    padding-bottom: env(safe-area-inset-bottom);
    background: rgba(13, 17, 23, 0.98);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-top: 1px solid var(--border-color);
    display: grid;
    grid-template-columns: 1fr 1fr;
    z-index: 9999;
}

.mobile-tabs button {
    background: none;
    border: none;
    color: var(--text-secondary);
    font-weight: 700;
    font-size: 0.95rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    width: 100%;
    transition: var(--transition-smooth);
    -webkit-tap-highlight-color: transparent;
}

.mobile-tabs button.active {
    color: var(--accent);
    background: rgba(16, 185, 129, 0.03);
    border-top: 2px solid var(--accent);
}

/* Login Card inside Mobile */
.login-card {
    margin: auto 0;
    padding: 1.5rem 0.5rem;
}

/* -------------------------------------------------------------
   🖥️ ADMIN PC LAYOUT STYLES (admin.html 전용)
   ------------------------------------------------------------- */
header {
    background: rgba(11, 15, 25, 0.85);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 100;
    padding: 1.2rem 2.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-family: 'Outfit', sans-serif;
    font-size: 1.6rem;
    font-weight: 800;
    background: linear-gradient(135deg, #10b981 0%, #3b82f6 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.logo span {
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
    padding: 2px 8px;
    border-radius: 20px;
    background: rgba(255,255,255,0.03);
    -webkit-text-fill-color: var(--text-secondary);
}

main {
    max-width: 1600px;
    margin: 0 auto;
    padding: 2rem;
}

.dashboard-panel {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-lg);
    padding: 1.8rem;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 1.2rem;
}

.panel-title {
    font-family: 'Outfit', sans-serif;
    font-size: 1.3rem;
    font-weight: 700;
}

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

.stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-lg);
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    position: relative;
    overflow: hidden;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: var(--accent);
}

.stat-card.warning::before {
    background: var(--warning);
}

.stat-card.danger::before {
    background: var(--danger);
}

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

.stat-value {
    font-family: 'Outfit', sans-serif;
    font-size: 2.3rem;
    font-weight: 800;
}

/* -------------------------------------------------------------
   🔑 COMMON COMPONENTS (폼, 테이블, 업로드, 버튼 등)
   ------------------------------------------------------------- */
.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

label {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-secondary);
}

input, select, textarea {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    padding: 0.8rem 1rem;
    border-radius: var(--border-radius-md);
    font-family: inherit;
    font-size: 0.95rem;
    transition: var(--transition-smooth);
    outline: none;
}

input:focus, select:focus, textarea:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 2px var(--accent-glow);
    background: rgba(255, 255, 255, 0.08);
}

/* Upload Row (2 Cards Side-by-Side) */
.upload-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.8rem;
}

.upload-card {
    background: rgba(255, 255, 255, 0.02);
    border: 2px dashed var(--border-color);
    border-radius: var(--border-radius-md);
    padding: 1.2rem 0.5rem;
    text-align: center;
    cursor: pointer;
    transition: var(--transition-smooth);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    min-height: 130px;
}

.upload-card:hover {
    border-color: var(--accent);
    background: rgba(16, 185, 129, 0.04);
}

.upload-card.has-image {
    border-style: solid;
    border-color: var(--accent);
    padding: 0;
    overflow: hidden;
    position: relative;
}

.upload-card img {
    width: 100%;
    height: 130px;
    object-fit: cover;
}

.upload-card .icon {
    font-size: 1.6rem;
    color: var(--text-secondary);
}

.upload-card:hover .icon {
    color: var(--accent);
}

.upload-title {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-secondary);
    line-height: 1.3;
}

.upload-card.has-image .timestamp-badge {
    position: absolute;
    bottom: 5px;
    right: 5px;
    background: rgba(0, 0, 0, 0.75);
    color: #ff9f43;
    font-size: 0.65rem;
    padding: 2px 6px;
    border-radius: 4px;
    font-family: 'Outfit', monospace;
    font-weight: bold;
    border: 1px solid rgba(255, 159, 67, 0.3);
}

/* Simulation Bar */
.simulation-bar {
    background: rgba(245, 158, 11, 0.08);
    border: 1px solid rgba(245, 158, 11, 0.15);
    border-radius: var(--border-radius-md);
    padding: 1rem;
    font-size: 0.8rem;
    color: var(--warning);
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}

.sim-btn {
    background: var(--warning);
    color: var(--bg-dark);
    border: none;
    padding: 8px 14px;
    font-size: 0.8rem;
    font-weight: bold;
    border-radius: var(--border-radius-sm);
    cursor: pointer;
    transition: var(--transition-smooth);
    width: 100%;
}

.sim-btn:hover {
    background: #e08e0b;
    box-shadow: 0 0 10px rgba(245, 158, 11, 0.3);
}

/* Buttons */
.btn-primary {
    background: var(--accent);
    color: var(--bg-dark);
    border: none;
    padding: 0.8rem;
    border-radius: var(--border-radius-md);
    font-weight: 700;
    font-size: 0.95rem;
    cursor: pointer;
    transition: var(--transition-smooth);
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
}

.btn-primary:hover {
    box-shadow: 0 0 20px rgba(16, 185, 129, 0.4);
    transform: translateY(-1px);
}

.btn-secondary {
    background: transparent;
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
    padding: 0.8rem;
    border-radius: var(--border-radius-md);
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition-smooth);
}

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

/* Table Design */
.table-container {
    overflow-x: auto;
}

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

th {
    padding: 1rem;
    border-bottom: 2px solid var(--border-color);
    color: var(--text-secondary);
    font-weight: 600;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

td {
    padding: 1rem;
    border-bottom: 1px solid var(--border-color);
    font-size: 0.95rem;
}

tr:hover td {
    background: rgba(255, 255, 255, 0.015);
}

/* Badges */
.badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: bold;
}

.badge.pending {
    background: rgba(245, 158, 11, 0.15);
    color: var(--warning);
}

.badge.approved {
    background: rgba(16, 185, 129, 0.15);
    color: var(--accent);
}

.badge.rejected {
    background: rgba(239, 68, 68, 0.15);
    color: var(--danger);
}

.action-btn-sm {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
    padding: 6px 12px;
    font-size: 0.8rem;
    font-weight: 600;
    border-radius: var(--border-radius-sm);
    cursor: pointer;
    transition: var(--transition-smooth);
}

.action-btn-sm:hover {
    background: var(--accent);
    color: var(--bg-dark);
    border-color: var(--accent);
}

/* Search panel styling */
.search-controls {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 1rem;
}

/* -------------------------------------------------------------
   ⚖️ MODAL WINDOW STYLING
   ------------------------------------------------------------- */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(11, 15, 25, 0.9);
    backdrop-filter: blur(8px);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    padding: 2rem;
}

.modal-overlay.active {
    display: flex;
}

.modal-content {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-lg);
    width: 100%;
    max-width: 950px;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.8);
    display: grid;
    grid-template-columns: 1.2fr 1fr;
    animation: scaleIn 0.3s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.modal-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: rgba(255, 255, 255, 0.05);
    border: none;
    color: var(--text-secondary);
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    transition: var(--transition-smooth);
    z-index: 10;
}

.modal-close:hover {
    background: rgba(255, 255, 255, 0.15);
    color: var(--text-primary);
}

.modal-images-area {
    padding: 2.2rem;
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    background: rgba(0,0,0,0.25);
}

.image-comparison-title {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.modal-image-wrapper {
    position: relative;
    border-radius: var(--border-radius-md);
    overflow: hidden;
    border: 1px solid var(--border-color);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
    height: 210px;
}

.modal-image-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.modal-image-wrapper .timestamp-badge {
    position: absolute;
    bottom: 10px;
    right: 10px;
    background: rgba(11, 15, 25, 0.85);
    color: #ff9f43;
    font-family: 'Outfit', monospace;
    font-weight: 800;
    font-size: 0.8rem;
    padding: 4px 10px;
    border-radius: var(--border-radius-sm);
    border: 1px solid rgba(255, 159, 67, 0.3);
}

.modal-decision-area {
    padding: 2.2rem;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.meta-info-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.2rem;
}

.meta-label {
    font-size: 0.75rem;
    color: var(--text-secondary);
    font-weight: 600;
}

.meta-value {
    font-size: 1rem;
    font-weight: 700;
}

.meta-value.license-plate {
    color: var(--accent);
    font-size: 1.3rem;
    font-family: 'Outfit', sans-serif;
}

.past-violations-widget {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-md);
    padding: 1rem;
}

.past-violations-title {
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
    display: flex;
    justify-content: space-between;
}

.past-violations-count {
    color: var(--warning);
    font-weight: 800;
}

.past-violation-list {
    list-style: none;
    max-height: 120px;
    overflow-y: auto;
    font-size: 0.8rem;
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.past-violation-item {
    display: flex;
    justify-content: space-between;
    padding: 4px 0;
    border-bottom: 1px solid rgba(255,255,255,0.03);
}

.past-violation-item:last-child {
    border: none;
}

.decision-actions {
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
}

.decision-buttons {
    display: grid;
    grid-template-columns: 1fr 1.2fr;
    gap: 0.8rem;
}

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

.btn-reject:hover {
    background: var(--danger);
    color: var(--bg-dark);
}

.btn-approve {
    background: var(--accent);
    color: var(--bg-dark);
}

.btn-approve:hover {
    background: #0ea5e9;
    box-shadow: 0 0 15px rgba(14, 165, 233, 0.4);
}

/* -------------------------------------------------------------
   📢 TOAST MESSAGES
   ------------------------------------------------------------- */
.toast {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    background: var(--bg-card);
    border: 1px solid var(--accent);
    color: var(--text-primary);
    padding: 1rem 1.5rem;
    border-radius: var(--border-radius-md);
    box-shadow: 0 10px 25px rgba(0,0,0,0.5);
    z-index: 2000;
    display: flex;
    align-items: center;
    gap: 0.8rem;
    transform: translateY(100px);
    opacity: 0;
    transition: var(--transition-smooth);
}

.toast.show {
    transform: translateY(0);
    opacity: 1;
}

.toast.error {
    border-color: var(--danger);
}

/* Mobile optimized toast overrides */
@media (max-width: 480px) {
    .toast {
        left: 1rem;
        right: 1rem;
        bottom: 5rem;
        font-size: 0.85rem;
    }
}

/* Keyframes */
@keyframes scaleIn {
    from { opacity: 0; transform: scale(0.96); }
    to { opacity: 1; transform: scale(1); }
}

/* Responsive for Admin Console */
@media (max-width: 1024px) {
    .modal-content {
        grid-template-columns: 1fr;
        max-height: 95vh;
    }
    
    .modal-images-area {
        border-right: none;
        border-bottom: 1px solid var(--border-color);
        padding: 1.5rem;
    }
    
    .modal-decision-area {
        padding: 1.5rem;
    }
}
