/* ParkingScan - Scanner Specific Styles */

.scanner-page {
    min-height: 100vh;
    background-color: var(--background-color);
}

/* Camera Container */
.camera-container {
    position: relative;
    background-color: #000;
    border-radius: var(--radius-lg);
    overflow: hidden;
    margin-bottom: 16px;
    aspect-ratio: 4/3;
    max-height: 50vh;
}

.camera-video {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.camera-guide {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 80%;
    height: 60px;
    border: 3px solid rgba(255, 255, 255, 0.8);
    border-radius: 8px;
    pointer-events: none;
}

.camera-guide::before {
    content: 'Align plate here';
    position: absolute;
    bottom: -25px;
    left: 50%;
    transform: translateX(-50%);
    color: white;
    font-size: 0.75rem;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
    white-space: nowrap;
}

.camera-error {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: white;
    text-align: center;
    padding: 20px;
}

.camera-error-icon {
    font-size: 3rem;
    margin-bottom: 16px;
}

.camera-error-text {
    margin-bottom: 16px;
}

/* Camera Controls */
.camera-controls {
    display: flex;
    gap: 12px;
    justify-content: center;
    margin-bottom: 16px;
}

.capture-btn {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    background-color: var(--primary-color);
    border: 4px solid white;
    box-shadow: var(--shadow-lg);
    cursor: pointer;
    transition: transform 0.1s;
}

.capture-btn:hover {
    transform: scale(1.05);
}

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

.capture-btn:disabled {
    background-color: var(--secondary-color);
    cursor: not-allowed;
}

.switch-camera-btn {
    width: 72px;
    height: 72px;
    background-color: var(--card-background);
    border: none;
    border-radius: 50%;
    box-shadow: var(--shadow);
    cursor: pointer;
    font-size: 1.5rem;
}

/* Manual Entry */
.manual-entry {
    background-color: var(--card-background);
    border-radius: var(--radius-lg);
    padding: 16px;
    margin-bottom: 16px;
}

.manual-entry-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.manual-entry-form {
    display: flex;
    gap: 8px;
}

.manual-entry-form .form-input {
    flex: 2;
    text-transform: uppercase;
}

.manual-entry-form .form-select {
    flex: 1;
    min-width: 80px;
}

.manual-entry-form .btn {
    flex-shrink: 0;
}

/* OCR Processing Overlay */
.processing-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.7);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: white;
}

.processing-spinner {
    width: 48px;
    height: 48px;
    border: 4px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 16px;
}

.processing-text {
    font-size: 0.875rem;
}

/* Result Section */
.result-section {
    margin-bottom: 16px;
}

.result-section h3 {
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

/* Warning Form */
.warning-form {
    background-color: var(--card-background);
    border-radius: var(--radius-lg);
    padding: 16px;
}

.warning-form h3 {
    font-size: 1rem;
    margin-bottom: 12px;
}

.warning-reasons {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 12px;
}

.reason-btn {
    padding: 8px 12px;
    border: 1px solid var(--border-color);
    background: var(--card-background);
    border-radius: var(--radius);
    cursor: pointer;
    font-size: 0.875rem;
    transition: all 0.2s;
}

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

.reason-btn.selected {
    background-color: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

/* Warning List */
.warnings-list {
    margin-top: 12px;
}

.warning-item {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    padding: 8px 0;
    border-bottom: 1px solid var(--border-color);
    font-size: 0.875rem;
}

.warning-item:last-child {
    border-bottom: none;
}

.warning-icon {
    color: var(--warning-color);
}

.warning-content {
    flex: 1;
}

.warning-reason {
    font-weight: 500;
}

.warning-date {
    font-size: 0.75rem;
    color: var(--text-secondary);
}

/* Scan History */
.scan-history {
    background-color: var(--card-background);
    border-radius: var(--radius-lg);
    padding: 16px;
}

.scan-history h3 {
    font-size: 1rem;
    margin-bottom: 12px;
}

.history-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    background-color: var(--background-color);
    border-radius: var(--radius);
    margin-bottom: 8px;
    cursor: pointer;
}

.history-item:hover {
    background-color: var(--border-color);
}

.history-status {
    width: 12px;
    height: 12px;
    border-radius: 50%;
}

.history-status.registered {
    background-color: var(--success-color);
}

.history-status.flagged {
    background-color: var(--danger-color);
}

.history-status.unknown {
    background-color: var(--warning-color);
}

.history-plate {
    font-weight: 600;
    flex: 1;
}

.history-time {
    font-size: 0.75rem;
    color: var(--text-secondary);
}

/* Hidden Canvas for Processing */
#processingCanvas {
    display: none;
}

/* Toast Notifications */
.toast-container {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 1100;
}

.toast {
    padding: 12px 24px;
    border-radius: var(--radius);
    color: white;
    font-size: 0.875rem;
    margin-top: 8px;
    animation: slideUp 0.3s ease;
    box-shadow: var(--shadow-lg);
}

.toast-success {
    background-color: var(--success-color);
}

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

.toast-warning {
    background-color: var(--warning-color);
}

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

/* Mobile Optimizations */
@media (max-width: 640px) {
    .camera-container {
        border-radius: 0;
        margin: -16px -16px 16px -16px;
        max-height: 40vh;
    }

    .camera-guide {
        width: 90%;
    }

    .manual-entry-form {
        flex-wrap: wrap;
    }

    .manual-entry-form .form-input {
        flex: 1 1 100%;
    }

    .manual-entry-form .form-select {
        flex: 1;
    }

    .manual-entry-form .btn {
        flex: 1;
    }
}

/* Landscape Mode */
@media (orientation: landscape) and (max-height: 500px) {
    .camera-container {
        max-height: 60vh;
    }

    .scanner-page .container {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 16px;
    }
}
