/* ============================================================================
   PATROL SCANNER - TABLET FRONTEND
   Estilos para interfaz de tablet en modo kiosk
   ============================================================================ */

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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #0a0a0a;
    color: #ffffff;
    overflow: hidden;
    -webkit-user-select: none;
    user-select: none;
}

/* App Container */
.app-container {
    display: flex;
    flex-direction: column;
    height: 100vh;
    width: 100vw;
    position: relative;
}

/* ============================================================================
   CAMERA VIEW
   ============================================================================ */

.camera-view {
    flex: 1;
    position: relative;
    background-color: #000;
    overflow: hidden;
}

#videoElement {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Overlay Info */
.overlay-info {
    position: absolute;
    top: 20px;
    left: 20px;
    right: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    pointer-events: none;
}

.tablet-id {
    background-color: rgba(0, 0, 0, 0.7);
    padding: 8px 16px;
    border-radius: 8px;
    font-weight: bold;
    font-size: 14px;
    color: #00ff00;
    border: 2px solid #00ff00;
}

.status {
    background-color: rgba(0, 0, 0, 0.7);
    padding: 8px 16px;
    border-radius: 8px;
    font-size: 14px;
    color: #ffffff;
}

/* ============================================================================
   CONTROLS
   ============================================================================ */

.controls {
    background: linear-gradient(180deg, #1a1a1a 0%, #0f0f0f 100%);
    padding: 24px;
    border-top: 2px solid #333;
}

.input-group {
    margin-bottom: 16px;
}

.input-group label {
    display: block;
    margin-bottom: 8px;
    font-size: 16px;
    font-weight: 600;
    color: #ccc;
}

#plateInput {
    width: 100%;
    padding: 16px;
    font-size: 24px;
    font-weight: bold;
    text-align: center;
    border: 2px solid #444;
    border-radius: 12px;
    background-color: #222;
    color: #fff;
    text-transform: uppercase;
    letter-spacing: 2px;
    transition: all 0.3s ease;
}

#plateInput:focus {
    outline: none;
    border-color: #00bfff;
    box-shadow: 0 0 20px rgba(0, 191, 255, 0.3);
}

#plateInput::placeholder {
    color: #666;
    text-transform: none;
    letter-spacing: normal;
}

/* Buttons */
.button-group {
    display: flex;
    gap: 12px;
}

.btn {
    flex: 1;
    padding: 20px;
    font-size: 18px;
    font-weight: bold;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.btn:active {
    transform: scale(0.95);
}

.btn-primary {
    background: linear-gradient(135deg, #0066cc 0%, #0052a3 100%);
    color: white;
    box-shadow: 0 4px 15px rgba(0, 102, 204, 0.4);
}

.btn-primary:hover {
    background: linear-gradient(135deg, #0052a3 0%, #003d7a 100%);
}

.btn-icon {
    font-size: 24px;
}

/* ============================================================================
   LOADING OVERLAY
   ============================================================================ */

.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.9);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.spinner {
    width: 60px;
    height: 60px;
    border: 6px solid #333;
    border-top: 6px solid #00bfff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 20px;
}

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

.loading-overlay p {
    font-size: 20px;
    color: #ccc;
}

/* ============================================================================
   ALERT OVERLAY (RED - Placa Requerida)
   ============================================================================ */

.alert-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #cc0000 0%, #8b0000 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    animation: alertPulse 1.5s ease-in-out infinite;
}

@keyframes alertPulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.9; }
}

.alert-content {
    text-align: center;
    padding: 40px;
}

.alert-icon {
    font-size: 120px;
    margin-bottom: 20px;
    animation: shake 0.5s ease-in-out infinite;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-10px); }
    75% { transform: translateX(10px); }
}

.alert-title {
    font-size: 48px;
    font-weight: bold;
    margin-bottom: 20px;
    text-shadow: 2px 2px 10px rgba(0, 0, 0, 0.5);
}

.alert-plate {
    font-size: 72px;
    font-weight: bold;
    margin: 30px 0;
    padding: 20px 40px;
    background-color: rgba(0, 0, 0, 0.3);
    border-radius: 16px;
    letter-spacing: 8px;
    text-shadow: 3px 3px 15px rgba(0, 0, 0, 0.7);
}

.alert-message {
    font-size: 28px;
    margin-bottom: 40px;
    opacity: 0.95;
}

.btn-dismiss {
    padding: 20px 60px;
    font-size: 24px;
    background-color: rgba(255, 255, 255, 0.2);
    color: white;
    border: 3px solid white;
}

.btn-dismiss:hover {
    background-color: rgba(255, 255, 255, 0.3);
}

/* ============================================================================
   SUCCESS OVERLAY (GREEN - Placa Limpia)
   ============================================================================ */

.success-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #00aa00 0%, #006600 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
}

.success-content {
    text-align: center;
    padding: 40px;
}

.success-icon {
    font-size: 120px;
    margin-bottom: 20px;
    color: white;
}

.success-title {
    font-size: 42px;
    font-weight: bold;
    margin-bottom: 20px;
}

.success-plate {
    font-size: 64px;
    font-weight: bold;
    margin: 20px 0;
    padding: 15px 30px;
    background-color: rgba(0, 0, 0, 0.2);
    border-radius: 12px;
    letter-spacing: 6px;
}

.success-message {
    font-size: 24px;
    opacity: 0.9;
}

/* ============================================================================
   ERROR MESSAGE
   ============================================================================ */

.error-message {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    background-color: #ff3333;
    color: white;
    padding: 16px 32px;
    border-radius: 8px;
    font-size: 16px;
    font-weight: bold;
    z-index: 3000;
    box-shadow: 0 4px 20px rgba(255, 51, 51, 0.5);
    animation: slideUp 0.3s ease-out;
}

@keyframes slideUp {
    from {
        bottom: -100px;
        opacity: 0;
    }
    to {
        bottom: 20px;
        opacity: 1;
    }
}

/* ============================================================================
   UTILITY CLASSES
   ============================================================================ */

.hidden {
    display: none !important;
}

/* ============================================================================
   RESPONSIVE (Tablet Landscape/Portrait)
   ============================================================================ */

@media (orientation: portrait) {
    .camera-view {
        height: 60vh;
    }

    .controls {
        height: 40vh;
    }
}

@media (orientation: landscape) {
    .app-container {
        flex-direction: row;
    }

    .camera-view {
        width: 65%;
    }

    .controls {
        width: 35%;
        border-top: none;
        border-left: 2px solid #333;
    }
}
