 /* Assegurar que les transicions de temes són suaus */
html.dark {
    color-scheme: dark;
}

body, html {
    transition: background-color 0.3s ease, color 0.3s ease;
}
/* Estils per al loader */
@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}
.animate-spin {
    animation: spin 1s linear infinite;
}
.drop-zone {
    transition: all 0.3s ease;
}

.drop-zone.drag-active {
    border-color: #3b82f6 !important; /* blue-500 */
    background-color: #eff6ff !important; /* blue-50 */
}

/* Estils per al mode fosc */
.dark .drop-zone.drag-active {
    border-color: #60a5fa !important; /* blue-400 */
    background-color: #1e3a8a !important; /* blue-900 */
}
.zona-imatge {
    transition: all 0.3s ease;
    cursor: pointer;
}

/* Estil per al hover normal */
.zona-imatge:hover {
    border-color: #93c5fd; /* blue-300 */
    background-color: #eff6ff; /* blue-50 */
}

/* Estil per al moment en què s'arrossega una imatge a sobre */
.zona-imatge.drag-active {
    border-color: #3b82f6 !important; /* blue-500 */
    background-color: #dbeafe !important; /* blue-100 */
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.3); /* blue-500 amb opacitat */
    transform: scale(1.01);
}

/* Estils per al mode fosc */
.dark .zona-imatge:hover {
    border-color: #60a5fa; /* blue-400 */
    background-color: #1e3a8a; /* blue-900 */
}

.dark .zona-imatge.drag-active {
    border-color: #60a5fa !important; /* blue-400 */
    background-color: #1e40af !important; /* blue-800 */
    box-shadow: 0 0 0 3px rgba(96, 165, 250, 0.3); /* blue-400 amb opacitat */
}

/* Estils per a la secció de càmera */
#seccio-camera {
    position: relative;
    border-radius: 0.5rem;
    overflow: hidden;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    margin-bottom: 1.5rem;
}

#video-camera {
    background-color: #111827; /* color fosc per quan s'està carregant el vídeo */
    min-height: 320px;
    object-fit: cover;
    width: 100%;
}

/* Estil millorat per al botó de captura */
#capturar-imatge {
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #ef4444; /* red-500 */
    color: white;
    font-weight: 600;
    padding: 0.75rem 1.5rem;
    border-radius: 9999px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    transition: all 0.2s;
}

#capturar-imatge:hover {
    background-color: #dc2626; /* red-600 */
    transform: translateY(-2px);
    box-shadow: 0 6px 10px rgba(0, 0, 0, 0.15);
}

#capturar-imatge:active {
    transform: translateY(0);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

/* Estil per al botó de tancar càmera */
#tancar-camera {
    z-index: 10;
    background-color: rgba(0, 0, 0, 0.7);
    color: white;
    border-radius: 9999px;
    padding: 0.5rem;
    transition: background-color 0.2s;
}

#tancar-camera:hover {
    background-color: rgba(0, 0, 0, 0.9);
}

/* Animació de pulsació per al botó de captura */
@keyframes pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.7);
    }
    70% {
        box-shadow: 0 0 0 10px rgba(239, 68, 68, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(239, 68, 68, 0);
    }
}

#capturar-imatge {
    animation: pulse 2s infinite;
}

/* Estil responsiu per a mòbils */
@media (max-width: 640px) {
    #seccio-camera {
        margin-left: -1rem;
        margin-right: -1rem;
        border-radius: 0;
    }
    
    #capturar-imatge {
        font-size: 0.875rem;
        padding: 0.5rem 1.25rem;
    }
}

/* Estil per al missatge flotant */
@keyframes slideUp {
    from {
        transform: translateY(100%);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}
