/* Reset y Base */
* {
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

body {
    font-family: 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    margin: 0;
    padding: 0;
    background-color: #000;
    color: #fff;
    overflow: hidden; /* Evitar scroll en la app shell */
    height: 100vh;
    width: 100vw;
    display: flex;
    flex-direction: column;
}

/* Cámara (Fondo) */
.camera-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    overflow: hidden;
}

#video {
    width: 100%;
    height: 100%;
    object-fit: cover; /* Llenar pantalla */
}

.scan-overlay {
    position: absolute;
    top: 20%;
    left: 10%;
    width: 80%;
    height: 40%;
    border: 2px dashed rgba(255, 255, 255, 0.7);
    border-radius: 12px;
    pointer-events: none;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% { border-color: rgba(255, 255, 255, 0.4); }
    50% { border-color: rgba(255, 255, 255, 0.9); }
    100% { border-color: rgba(255, 255, 255, 0.4); }
}

/* Header */
.app-header {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    padding: 15px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 10;
    background: linear-gradient(to bottom, rgba(0,0,0,0.6), transparent);
}

.logo-container {
    display: flex;
    align-items: center;
    gap: 10px;
}

.logo-img {
    height: 40px;
    width: 40px;
    border-radius: 8px;
    border: 2px solid #fff;
}

.app-title {
    font-size: 1.2rem;
    font-weight: bold;
    text-shadow: 0 2px 4px rgba(0,0,0,0.5);
}

.icon-btn {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: #fff;
    font-size: 1.5rem;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    backdrop-filter: blur(5px);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Tarjeta de Resultado */
.result-card {
    position: absolute;
    bottom: 100px; /* Espacio para controles */
    left: 10px;
    right: 10px;
    background: rgba(255, 255, 255, 0.95);
    color: #222;
    border-radius: 20px;
    padding: 20px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.3);
    z-index: 20;
    transition: transform 0.3s ease, opacity 0.3s ease;
    max-height: 50vh;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.result-card.hidden {
    transform: translateY(20px);
    opacity: 0;
    pointer-events: none;
}

.result-card.visible {
    transform: translateY(0);
    opacity: 1;
    pointer-events: auto;
}

.drag-handle {
    width: 40px;
    height: 5px;
    background: #ddd;
    border-radius: 3px;
    margin-bottom: 15px;
}

.result-text {
    font-size: 1.4rem; /* Lectura Fácil: Letra grande */
    line-height: 1.5;
    text-align: center;
    margin-bottom: 15px;
    font-weight: 500;
}

.action-buttons {
    width: 100%;
    display: flex;
    justify-content: center;
    gap: 15px;
}

.action-btn {
    background: #1976d2;
    color: #fff;
    border: none;
    padding: 12px 24px;
    border-radius: 50px;
    font-size: 1.1rem;
    font-weight: bold;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
    display: flex;
    align-items: center;
    gap: 8px;
}

.action-btn.share {
    background: #25D366; /* Color verde tipo compartir/WhatsApp */
}

/* Controles Inferiores */
.bottom-controls {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 100px;
    background: linear-gradient(to top, rgba(0,0,0,0.8), transparent);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 30;
    padding-bottom: 20px;
}

.fab-btn {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: #fff;
    border: 4px solid #ddd; /* Anillo exterior */
    font-size: 2.5rem;
    color: #333;
    box-shadow: 0 4px 15px rgba(0,0,0,0.3);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    position: relative;
}

.fab-btn:active {
    transform: scale(0.9);
    background: #eee;
}

/* Estado de carga */
.fab-btn.loading {
    animation: spin 1s linear infinite;
    font-size: 2rem;
    background: #f0f0f0;
    border-color: #1976d2;
}

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

/* Estado de Reset (Nueva foto) */
.fab-btn.reset-mode {
    background: #1976d2;
    color: #fff;
    border-color: #fff;
    font-size: 2rem;
}

.status-text {
    margin-top: 10px;
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.8);
    font-weight: 500;
}
