/* filepath: customers-moai/src/views/qr_code/qrcode.css */
/* Variáveis de cores consistentes com o projeto */
:root {
    --ocean-primary: #1e3a8a;
    --ocean-secondary: #1e40af;
    --ocean-light: #3b82f6;
    --tropical-gold: #fbbf24;
    --success-green: #10b981;
    --error-red: #ef4444;
    --text-light: rgba(255, 255, 255, 0.9);
    --text-muted: rgba(255, 255, 255, 0.7);
}

/* Reset e configuração base */
.qrcode-page {
    margin: 0;
    padding: 0;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    overflow-x: hidden;
}

.qrcode-container {
    position: relative;
    min-height: 100vh;
    background: linear-gradient(135deg, var(--ocean-primary) 0%, var(--ocean-secondary) 50%, #1e3a8a 100%);
    color: white;
    display: flex;
    flex-direction: column;
}

/* Fundo oceânico estático (SEM ondas em movimento) */
.ocean-background {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
    background: linear-gradient(135deg, var(--ocean-primary) 0%, var(--ocean-secondary) 50%, #1e3a8a 100%);
    /* Textura sutil sem movimento */
    background-image:
        radial-gradient(circle at 25% 25%, rgba(59, 130, 246, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 75% 75%, rgba(59, 130, 246, 0.05) 0%, transparent 50%);
}

/* Partículas flutuantes sutis (movimento muito leve) */
.floating-particles {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 2;
    pointer-events: none;
}

.particle {
    position: absolute;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 50%;
    animation: subtle-float 8s ease-in-out infinite;
}

.particle-1 {
    width: 6px;
    height: 6px;
    top: 30%;
    left: 20%;
    animation-delay: 0s;
}

.particle-2 {
    width: 8px;
    height: 8px;
    top: 70%;
    right: 30%;
    animation-delay: 3s;
}

.particle-3 {
    width: 4px;
    height: 4px;
    top: 50%;
    left: 80%;
    animation-delay: 6s;
}

@keyframes subtle-float {
    0%, 100% {
        transform: translateY(0) translateX(0);
        opacity: 0.1;
    }
    50% {
        transform: translateY(-8px) translateX(4px);
        opacity: 0.3;
    }
}

/* Header */
.qrcode-header {
    position: relative;
    z-index: 10;
    padding: 20px;
    background: rgba(0, 0, 0, 0.2);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.back-btn {
    border: 2px solid rgba(255, 255, 255, 0.3);
    color: white;
    background: rgba(255, 255, 255, 0.1);
    padding: 8px 16px;
    border-radius: 25px;
    transition: all 0.3s ease;
    margin-bottom: 15px;
}

.back-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.5);
    color: white;
    transform: translateY(-2px);
}

.header-title h1 {
    margin: 0;
    font-size: 1.8rem;
    font-weight: 600;
    color: white;
}

.header-subtitle {
    margin: 5px 0 0 0;
    color: var(--text-muted);
    font-size: 0.95rem;
}

/* Conteúdo principal */
.qrcode-main {
    flex: 1;
    position: relative;
    z-index: 5;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    min-height: 60vh;
}

/* Estados de loading com tema oceânico (SEM ondas) */
.ocean-loading,
.success-ocean,
.error-ocean,
.welcome-ocean {
    position: relative;
    width: 120px;
    height: 120px;
    margin: 0 auto 20px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.ocean-waves-loading,
.success-waves,
.error-waves,
.welcome-waves {
    position: absolute;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    border: 3px solid rgba(255, 255, 255, 0.2);
    /* REMOVIDO: animation: ripple 2s ease-in-out infinite; */
}

.ocean-waves-loading::before,
.success-waves::before,
.error-waves::before,
.welcome-waves::before {
    content: '';
    position: absolute;
    top: -6px;
    left: -6px;
    right: -6px;
    bottom: -6px;
    border-radius: 50%;
    border: 3px solid rgba(255, 255, 255, 0.1);
    /* REMOVIDO: animation: ripple 2s ease-in-out infinite 0.5s; */
}

.loading-icon,
.success-icon,
.error-icon,
.welcome-icon {
    font-size: 3rem;
    z-index: 2;
    /* REMOVIDO: animation: pulse 2s ease-in-out infinite; */
}

.loading-icon { color: var(--ocean-light); }
.success-icon { color: var(--success-green); }
.error-icon { color: var(--error-red); }
.welcome-icon { color: var(--tropical-gold); }

.loading-icon.processing {
    animation: spin 1s linear infinite;
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* Scanner */
.scanner-container {
    text-align: center;
    max-width: 500px;
    width: 100%;
}

.scanner-wrapper {
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 20px 0;
}

.qr-scanner {
    width: 100%;
    height: 400px;
    max-height: 60vh;
    position: relative;
    border-radius: 15px;
    overflow: hidden;
    background: #000;
}

.qr-scanner video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 15px;
}

.qr-scanner canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border-radius: 15px;
}

.scanner-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 10;
}

.scan-frame {
    position: relative;
    width: 250px;
    height: 250px;
    margin: auto;
    top: 50%;
    transform: translateY(-50%);
}

.corner {
    position: absolute;
    width: 30px;
    height: 30px;
    border: 3px solid #00ff00;
}

.corner-tl {
    top: 0;
    left: 0;
    border-right: none;
    border-bottom: none;
    border-top-left-radius: 10px;
}

.corner-tr {
    top: 0;
    right: 0;
    border-left: none;
    border-bottom: none;
    border-top-right-radius: 10px;
}

.corner-bl {
    bottom: 0;
    left: 0;
    border-right: none;
    border-top: none;
    border-bottom-left-radius: 10px;
}

.corner-br {
    bottom: 0;
    right: 0;
    border-left: none;
    border-top: none;
    border-bottom-right-radius: 10px;
}

.scan-line {
    position: absolute;
    width: 100%;
    height: 2px;
    background: linear-gradient(90deg, transparent, #00ff00, transparent);
    top: 50%;
    animation: scanline 2s linear infinite;
}

@keyframes scanline {
    0% { transform: translateY(-125px); }
    100% { transform: translateY(125px); }
}

.scanner-instructions {
    text-align: center;
}

.instruction-text {
    font-size: 1.1rem;
    color: var(--text-light);
    margin-bottom: 10px;
}

.device-indicator {
    margin-top: 10px;
}

/* Containers de estado */
.init-container,
.processing-container,
.success-container,
.error-container,
.welcome-container {
    text-align: center;
    max-width: 500px;
    width: 100%;
}

.init-container h3,
.processing-container h3,
.welcome-container h3 {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 10px;
    color: var(--text-light);
}

.success-title {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 15px;
    color: var(--success-green);
}

.error-title {
    font-size: 1.6rem;
    font-weight: 600;
    margin-bottom: 15px;
    color: var(--error-red);
}

.success-message,
.error-message,
.welcome-text {
    font-size: 1rem;
    color: var(--text-muted);
    margin-bottom: 20px;
    line-height: 1.5;
}

/* Cards e elementos especiais */
.result-card,
.help-card {
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 15px;
    padding: 15px;
    margin: 20px 0;
    backdrop-filter: blur(10px);
}

.permission-steps {
    list-style: none;
    padding: 0;
    margin: 15px 0;
    text-align: left;
}

.permission-steps li {
    padding: 8px 0;
    color: var(--text-muted);
    font-size: 0.9rem;
}

.welcome-instructions {
    list-style: none;
    padding: 0;
    margin: 20px 0;
    text-align: left;
}

.welcome-instructions li {
    padding: 8px 0;
    color: var(--text-light);
    font-size: 0.95rem;
}

/* Botões */
.btn-primary {
    background: linear-gradient(135deg, var(--ocean-light), var(--ocean-secondary));
    border: none;
    padding: 12px 30px;
    border-radius: 25px;
    font-weight: 600;
    transition: all 0.3s ease;
    box-shadow: 0 5px 15px rgba(59, 130, 246, 0.3);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(59, 130, 246, 0.4);
    background: linear-gradient(135deg, #60a5fa, var(--ocean-light));
}

.btn-lg {
    padding: 15px 40px;
    font-size: 1.1rem;
}

/* Footer */
.qrcode-footer {
    position: relative;
    z-index: 10;
    padding: 20px;
    text-align: center;
    background: rgba(0, 0, 0, 0.2);
    backdrop-filter: blur(20px);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.footer-info {
    margin: 0;
    color: var(--text-muted);
    font-size: 0.9rem;
}

/* Responsividade */
@media (max-width: 768px) {
    .qrcode-header {
        padding: 15px;
    }

    .header-title h1 {
        font-size: 1.5rem;
    }

    .qrcode-main {
        padding: 15px;
        min-height: 50vh;
    }

    .qr-scanner {
        height: 300px;
        max-height: 50vh;
    }

    .scan-frame {
        width: 200px;
        height: 200px;
    }

    .corner {
        width: 25px;
        height: 25px;
        border-width: 2px;
    }

    .ocean-loading,
    .success-ocean,
    .error-ocean,
    .welcome-ocean {
        width: 100px;
        height: 100px;
    }

    .loading-icon,
    .success-icon,
    .error-icon,
    .welcome-icon {
        font-size: 2.5rem;
    }

    .success-title {
        font-size: 1.6rem;
    }
}

@media (max-width: 480px) {
    .qr-scanner {
        height: 250px;
    }

    .scan-frame {
        width: 180px;
        height: 180px;
    }

    .back-btn span {
        display: none;
    }

    .permission-steps,
    .welcome-instructions {
        font-size: 0.85rem;
    }
}

/* Melhorias para Quagga no mobile */
@media (max-width: 768px) {
    #qr-scanner canvas,
    #qr-scanner video {
        width: 100% !important;
        height: auto !important;
        max-height: 280px !important;
        object-fit: cover;
        border-radius: 20px;
    }
}

/* Orientação landscape */
@media (max-width: 768px) and (orientation: landscape) {
    .qr-scanner {
        height: 60vh;
    }

    .qrcode-main {
        padding: 10px;
    }

    .qrcode-header {
        padding: 10px 15px;
    }
}
