/**
 * Driver's License Scanner - Styles
 * Clean, functional, responsive design
 */

/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: linear-gradient(135deg, rgba(155, 44, 44, 0.15) 0%, rgba(197, 48, 48, 0.2) 100%),
                linear-gradient(to bottom, #f7fafc 0%, #edf2f7 100%);
    min-height: 100vh;
    padding: 20px;
    color: #333;
}

/* Container */
.container {
    max-width: 1200px;
    margin: 0 auto;
    background: white;
    border-radius: 12px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    overflow: hidden;
}

/* Header */
header {
    background: linear-gradient(135deg, #9B2C2C 0%, #742A2A 100%);
    color: white;
    padding: 40px;
    text-align: center;
    border-bottom: 4px solid #2C5282;
}

header h1 {
    font-size: 2.5rem;
    margin-bottom: 10px;
    font-weight: 700;
}

.subtitle {
    font-size: 1.1rem;
    opacity: 0.9;
}

/* Sections */
section {
    padding: 30px 40px;
    border-bottom: 1px solid #e0e0e0;
}

section:last-of-type {
    border-bottom: none;
}

section h2 {
    font-size: 1.5rem;
    margin-bottom: 20px;
    color: #2C5282;
    font-weight: 700;
    border-bottom: 3px solid #C53030;
    padding-bottom: 10px;
    display: inline-block;
}

/* Session Control */
.session-control {
    background: linear-gradient(to right, #f8f9fa 0%, #fff 50%, #f8f9fa 100%);
    border-left: 5px solid #C53030;
    border-right: 5px solid #2C5282;
}

.session-status {
    text-align: center;
    margin-bottom: 20px;
}

.status-badge {
    display: inline-block;
    padding: 12px 24px;
    border-radius: 25px;
    font-weight: 600;
    font-size: 1rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.status-badge.active {
    background: #C53030;
    color: white;
    border: 2px solid #2C5282;
}

.status-badge.inactive {
    background: #6b7280;
    color: white;
}

.session-id-display {
    text-align: center;
    margin-bottom: 20px;
}

.session-id-display label {
    display: block;
    font-size: 0.9rem;
    color: #666;
    margin-bottom: 5px;
}

.session-id {
    font-size: 2rem;
    font-weight: 700;
    color: #C53030;
    letter-spacing: 3px;
    font-family: 'Courier New', monospace;
}

.session-buttons {
    display: flex;
    gap: 15px;
    justify-content: center;
}

/* Buttons */
.btn {
    padding: 12px 30px;
    border: none;
    border-radius: 6px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

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

.btn-primary {
    background: #C53030;
    color: white;
    border: 2px solid #2C5282;
}

.btn-primary:hover {
    background: #9B2C2C;
    border-color: #2A4365;
}

.btn-secondary {
    background: #742A2A;
    color: white;
    border: 2px solid #2C5282;
}

.btn-secondary:hover {
    background: #63171B;
    border-color: #2A4365;
}

.btn-success {
    background: #2C5282;
    color: white;
    border: 2px solid #C53030;
}

.btn-success:hover {
    background: #2A4365;
    border-color: #9B2C2C;
}

.btn-success:disabled {
    background: #d1d5db;
    cursor: not-allowed;
    transform: none;
}

.btn-clear {
    background: #6b7280;
    color: white;
    padding: 12px 20px;
}

.btn-clear:hover {
    background: #4b5563;
}

/* Swipe Input */
.swipe-input {
    background: #fefefe;
}

.input-group {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
}

.swipe-field {
    flex: 1;
    padding: 15px;
    border: 2px solid #d1d5db;
    border-radius: 6px;
    font-size: 1rem;
    transition: border-color 0.3s ease;
    font-family: 'Courier New', monospace;
}

.swipe-field:focus {
    outline: none;
    border-color: #C53030;
    box-shadow: 0 0 0 3px rgba(197, 48, 48, 0.1);
}

.swipe-feedback {
    padding: 10px 15px;
    border-radius: 6px;
    margin-bottom: 10px;
    font-weight: 500;
}

.swipe-feedback.success {
    background: #d1fae5;
    color: #065f46;
    border: 1px solid #10b981;
}

.swipe-feedback.error {
    background: #fee2e2;
    color: #991b1b;
    border: 1px solid #ef4444;
}

.swipe-feedback.warning {
    background: #fef3c7;
    color: #92400e;
    border: 1px solid #f59e0b;
}

.last-swipe {
    padding: 15px;
    background: #f3f4f6;
    border-radius: 6px;
    color: #374151;
    font-size: 0.95rem;
}

.last-swipe strong {
    color: #1f2937;
}

/* Swipes List */
.swipes-list {
    background: #fefefe;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.swipe-count {
    background: #C53030;
    color: white;
    padding: 8px 16px;
    border-radius: 20px;
    font-weight: 600;
    border: 2px solid #2C5282;
}

.swipe-count span {
    font-size: 1.2rem;
}

.table-container {
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
}

thead {
    background: linear-gradient(135deg, #2C5282 0%, #2A4365 100%);
}

th {
    padding: 15px;
    text-align: left;
    font-weight: 600;
    color: white;
    border-bottom: 2px solid #C53030;
    text-transform: uppercase;
    font-size: 0.85rem;
    letter-spacing: 0.5px;
}

td {
    padding: 15px;
    border-bottom: 1px solid #e5e7eb;
    color: #4b5563;
}

tbody tr:hover {
    background: #fff5f5;
    border-left: 3px solid #C53030;
}

.no-data {
    text-align: center;
    color: #9ca3af;
    font-style: italic;
    padding: 40px !important;
}

/* Export Section */
.export-section {
    text-align: center;
    background: linear-gradient(to right, #f8f9fa 0%, #fff 50%, #f8f9fa 100%);
    border-left: 5px solid #C53030;
    border-right: 5px solid #2C5282;
}

.export-section p {
    margin-bottom: 20px;
    color: #6b7280;
}

/* Session Lookup Section */
.session-lookup {
    padding: 40px;
    border-bottom: 1px solid #e5e7eb;
    background: linear-gradient(to right, #f8f9fa 0%, #fff 50%, #f8f9fa 100%);
    border-left: 5px solid #C53030;
    border-right: 5px solid #2C5282;
}

.session-lookup h2 {
    font-size: 1.5rem;
    margin-bottom: 10px;
    color: #2C5282;
    font-weight: 700;
    border-bottom: 3px solid #C53030;
    padding-bottom: 10px;
    display: inline-block;
}

.session-lookup p {
    color: #6b7280;
    margin-bottom: 20px;
    font-size: 0.95rem;
}

.lookup-group {
    display: flex;
    gap: 15px;
    margin-bottom: 15px;
    align-items: stretch;
}

.session-input {
    flex: 1;
    padding: 12px 20px;
    border: 2px solid #d1d5db;
    border-radius: 6px;
    font-size: 1rem;
    font-family: 'Courier New', monospace;
    text-transform: uppercase;
    transition: border-color 0.3s ease;
}

.session-input:focus {
    outline: none;
    border-color: #C53030;
    box-shadow: 0 0 0 3px rgba(197, 48, 48, 0.1);
}

.lookup-info-card {
    background: white;
    border: 2px solid #2C5282;
    border-radius: 8px;
    padding: 20px;
    margin-top: 20px;
}

.info-row {
    display: flex;
    justify-content: space-between;
    padding: 10px 0;
    border-bottom: 1px solid #e5e7eb;
}

.info-row:last-of-type {
    border-bottom: none;
    margin-bottom: 15px;
}

.info-label {
    font-weight: 600;
    color: #4b5563;
}

.info-value {
    color: #1f2937;
    font-family: 'Courier New', monospace;
}

.status-active {
    color: #C53030 !important;
    font-weight: 700;
}

.status-closed {
    color: #6b7280 !important;
}

/* Footer */
footer {
    padding: 20px 40px;
    text-align: center;
    background: linear-gradient(135deg, #2C5282 0%, #2A4365 100%);
    color: #ffffff;
    font-size: 0.9rem;
    border-top: 3px solid #C53030;
}

/* Loading Overlay */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #C53030;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* Responsive Design */
@media (max-width: 768px) {
    body {
        padding: 10px;
    }

    header h1 {
        font-size: 2rem;
    }

    section {
        padding: 20px;
    }

    .session-buttons {
        flex-direction: column;
    }

    .btn {
        width: 100%;
    }

    .input-group {
        flex-direction: column;
    }

    .section-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }

    table {
        font-size: 0.9rem;
    }

    th, td {
        padding: 10px 8px;
    }
}

@media (max-width: 480px) {
    header h1 {
        font-size: 1.5rem;
    }

    .subtitle {
        font-size: 0.9rem;
    }

    .session-id {
        font-size: 1.5rem;
    }

    table {
        font-size: 0.8rem;
    }

    th, td {
        padding: 8px 5px;
    }
}
