/* ============================================
   Photobooth - Estilos CSS
   Sistema de Cabine Fotográfica
   ============================================ */

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

html, body {
    width: 100%;
    height: 100%;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: #000;
    color: #fff;
    overflow: hidden;
}

/* ============================================
   Layout Principal
   ============================================ */

.container {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.page {
    display: none;
    width: 100%;
    height: 100%;
}

.page.active {
    display: flex;
}

/* ============================================
   Página de Preview ao Vivo
   ============================================ */

#livePreviewPage {
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #0f0f0f 0%, #1a1a1a 100%);
}

#videoContainer {
    position: relative;
    width: 100%;
    height: 85%;
    background: #000;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

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

.video-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    pointer-events: none;
}

.video-status {
    position: absolute;
    top: 2rem;
    left: 2rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    font-size: 1.5rem;
    z-index: 10;
}

.status-indicator {
    width: 1rem;
    height: 1rem;
    border-radius: 50%;
    background: #10b981;
    animation: pulse 2s infinite;
}

.status-indicator.loading {
    background: #f59e0b;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.countdown-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 15rem;
    font-weight: bold;
    color: #fff;
    opacity: 0;
    transition: opacity 0.3s;
    z-index: 20;
}

.countdown-overlay.active {
    opacity: 1;
}

@keyframes countdownPulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.1); }
    100% { transform: scale(1); }
}

.countdown-overlay.active {
    animation: countdownPulse 1s ease-in-out;
}

/* ============================================
   Controles Inferiores
   ============================================ */

.controls {
    width: 100%;
    height: 15%;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.8), transparent);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 2rem;
    padding: 2rem;
}

.btn {
    padding: 1rem 2rem;
    font-size: 1.25rem;
    font-weight: 600;
    border: none;
    border-radius: 0.75rem;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    min-width: 200px;
    justify-content: center;
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn-primary {
    background: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%);
    color: #fff;
    box-shadow: 0 10px 30px rgba(59, 130, 246, 0.3);
}

.btn-primary:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 15px 40px rgba(59, 130, 246, 0.5);
}

.btn-success {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: #fff;
    box-shadow: 0 10px 30px rgba(16, 185, 129, 0.3);
}

.btn-success:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 15px 40px rgba(16, 185, 129, 0.5);
}

.btn-danger {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    color: #fff;
    box-shadow: 0 10px 30px rgba(239, 68, 68, 0.3);
}

.btn-danger:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 15px 40px rgba(239, 68, 68, 0.5);
}

.btn-secondary {
    background: linear-gradient(135deg, #6b7280 0%, #4b5563 100%);
    color: #fff;
    box-shadow: 0 10px 30px rgba(107, 114, 128, 0.3);
}

.btn-secondary:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 15px 40px rgba(107, 114, 128, 0.5);
}

/* ============================================
   Página de Revisão de Foto
   ============================================ */

#photoReviewPage {
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #0f0f0f 0%, #1a1a1a 100%);
    padding: 2rem;
}

.photo-review-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2rem;
    width: 100%;
    max-width: 1000px;
}

.photo-preview {
    width: 100%;
    max-width: 800px;
    aspect-ratio: 16 / 9;
    border-radius: 1rem;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    border: 3px solid #3b82f6;
}

.photo-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.photo-info {
    text-align: center;
    font-size: 1.5rem;
    color: #d1d5db;
}

.review-buttons {
    display: flex;
    gap: 2rem;
    justify-content: center;
    flex-wrap: wrap;
}

.review-buttons .btn {
    min-width: 250px;
    padding: 1.5rem 2rem;
    font-size: 1.5rem;
}

/* ============================================
   Página de Fila de Impressão
   ============================================ */

#printQueuePage {
    flex-direction: column;
    background: linear-gradient(135deg, #0f0f0f 0%, #1a1a1a 100%);
    padding: 2rem;
}

.queue-header {
    text-align: center;
    margin-bottom: 2rem;
}

.queue-header h1 {
    font-size: 3rem;
    margin-bottom: 0.5rem;
}

.queue-header p {
    font-size: 1.5rem;
    color: #9ca3af;
}

.queue-list {
    flex: 1;
    overflow-y: auto;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.queue-item {
    background: rgba(255, 255, 255, 0.05);
    border: 2px solid rgba(255, 255, 255, 0.1);
    border-radius: 1rem;
    padding: 1.5rem;
    transition: all 0.3s ease;
}

.queue-item:hover {
    border-color: rgba(59, 130, 246, 0.5);
    background: rgba(59, 130, 246, 0.05);
}

.queue-item-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
}

.queue-status-icon {
    font-size: 2rem;
}

.queue-item-info {
    flex: 1;
}

.queue-item-info h3 {
    font-size: 1.25rem;
    margin-bottom: 0.25rem;
}

.queue-item-info p {
    font-size: 0.9rem;
    color: #9ca3af;
}

.queue-item-thumbnail {
    width: 100%;
    aspect-ratio: 16 / 9;
    border-radius: 0.5rem;
    overflow: hidden;
    margin-bottom: 1rem;
    background: #1f2937;
}

.queue-item-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.queue-item-actions {
    display: flex;
    gap: 0.5rem;
}

.queue-item-actions .btn {
    flex: 1;
    padding: 0.75rem;
    font-size: 0.9rem;
    min-width: auto;
}

.queue-empty {
    text-align: center;
    padding: 3rem;
    color: #9ca3af;
    font-size: 1.5rem;
}

/* ============================================
   Página de Galeria
   ============================================ */

#galleryPage {
    flex-direction: column;
    background: linear-gradient(135deg, #0f0f0f 0%, #1a1a1a 100%);
    padding: 2rem;
}

.gallery-header {
    text-align: center;
    margin-bottom: 2rem;
}

.gallery-header h1 {
    font-size: 3rem;
    margin-bottom: 0.5rem;
}

.gallery-grid {
    flex: 1;
    overflow-y: auto;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.gallery-item {
    position: relative;
    aspect-ratio: 16 / 9;
    border-radius: 0.75rem;
    overflow: hidden;
    cursor: pointer;
    transition: transform 0.3s ease;
    border: 2px solid rgba(255, 255, 255, 0.1);
}

.gallery-item:hover {
    transform: scale(1.05);
}

.gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.gallery-item-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.gallery-item:hover .gallery-item-overlay {
    opacity: 1;
}

.gallery-item-overlay button {
    width: 3rem;
    height: 3rem;
    border-radius: 50%;
    border: none;
    cursor: pointer;
    font-size: 1.5rem;
    transition: all 0.3s ease;
}

.gallery-empty {
    text-align: center;
    padding: 3rem;
    color: #9ca3af;
    font-size: 1.5rem;
}

/* ============================================
   Modal de Fullscreen
   ============================================ */

.modal {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.95);
    z-index: 1000;
    align-items: center;
    justify-content: center;
    padding: 2rem;
}

.modal.active {
    display: flex;
}

.modal-content {
    position: relative;
    max-width: 90vw;
    max-height: 90vh;
}

.modal-content img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.modal-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    width: 3rem;
    height: 3rem;
    background: #ef4444;
    border: none;
    border-radius: 50%;
    color: #fff;
    font-size: 1.5rem;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-close:hover {
    background: #dc2626;
    transform: scale(1.1);
}

/* ============================================
   Notificações
   ============================================ */

.notification {
    position: fixed;
    top: 2rem;
    right: 2rem;
    padding: 1.5rem 2rem;
    border-radius: 0.75rem;
    font-size: 1.1rem;
    z-index: 2000;
    animation: slideIn 0.3s ease;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

@keyframes slideIn {
    from {
        transform: translateX(400px);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.notification.success {
    background: #10b981;
    color: #fff;
}

.notification.error {
    background: #ef4444;
    color: #fff;
}

.notification.info {
    background: #3b82f6;
    color: #fff;
}

/* ============================================
   Responsividade
   ============================================ */

@media (max-width: 1024px) {
    .btn {
        min-width: 150px;
        padding: 0.75rem 1.5rem;
        font-size: 1rem;
    }

    .gallery-grid {
        grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    }

    .queue-list {
        grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    }
}

@media (max-width: 768px) {
    .btn {
        min-width: 120px;
        padding: 0.5rem 1rem;
        font-size: 0.9rem;
    }

    .controls {
        flex-wrap: wrap;
        gap: 1rem;
        height: auto;
        padding: 1rem;
    }

    #videoContainer {
        height: 70%;
    }

    .gallery-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
        gap: 1rem;
    }

    .queue-list {
        grid-template-columns: 1fr;
    }

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

    .review-buttons .btn {
        min-width: auto;
        width: 100%;
    }
}

/* ============================================
   Loading Spinner
   ============================================ */

.spinner {
    border: 4px solid rgba(255, 255, 255, 0.1);
    border-top: 4px solid #3b82f6;
    border-radius: 50%;
    width: 2rem;
    height: 2rem;
    animation: spin 1s linear infinite;
}

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

/* ============================================
   Scrollbar Customizado
   ============================================ */

::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
}

::-webkit-scrollbar-thumb {
    background: rgba(59, 130, 246, 0.5);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(59, 130, 246, 0.7);
}
