/* Variables del Sistema de Diseño */
:root {
    --bg-dark: #0b0f19;
    --card-bg: rgba(25, 33, 50, 0.65);
    --card-border: rgba(255, 255, 255, 0.08);
    --text-primary: #f3f4f6;
    --text-secondary: #9ca3af;
    --accent-primary: #3b82f6; /* Azul */
    --accent-secondary: #8b5cf6; /* Púrpura */
    --accent-gradient: linear-gradient(135deg, #3b82f6 0%, #8b5cf6 100%);
    --accent-hover-gradient: linear-gradient(135deg, #2563eb 0%, #7c3aed 100%);
    --error-color: #ef4444;
    --error-bg: rgba(239, 68, 68, 0.1);
    --success-color: #10b981;
    --success-bg: rgba(16, 185, 129, 0.1);
    --radius-lg: 16px;
    --radius-md: 12px;
    --shadow-premium: 0 20px 40px -15px rgba(0, 0, 0, 0.5);
    --transition-smooth: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Reset y Estilos Generales */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-dark);
    color: var(--text-primary);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow-x: hidden;
    position: relative;
}

/* Fondo con Luces Difusas (Ambient Light) */
.glass-background {
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    z-index: -1;
    overflow: hidden;
}

.glass-background::before,
.glass-background::after {
    content: '';
    position: absolute;
    width: 350px;
    height: 350px;
    border-radius: 50%;
    filter: blur(120px);
    opacity: 0.25;
}

.glass-background::before {
    background: var(--accent-primary);
    top: -50px;
    right: 10%;
    animation: float-slow 15s infinite alternate;
}

.glass-background::after {
    background: var(--accent-secondary);
    bottom: -50px;
    left: 10%;
    animation: float-slow 18s infinite alternate-reverse;
}

@keyframes float-slow {
    0% { transform: translate(0, 0) scale(1); }
    100% { transform: translate(50px, 30px) scale(1.15); }
}

/* Contenedor Principal */
.app-container {
    width: 100%;
    max-width: 580px;
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 32px;
    z-index: 1;
}

/* Encabezado */
.app-header {
    text-align: center;
}

.logo-container {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin-bottom: 12px;
}

.logo-icon {
    font-size: 2.2rem;
    animation: pulse-micro 3s infinite ease-in-out;
}

.app-header h1 {
    font-family: 'Outfit', sans-serif;
    font-size: 2.4rem;
    font-weight: 700;
    letter-spacing: -0.5px;
    color: var(--text-primary);
}

.app-header h1 span {
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    font-weight: 500;
    margin: 0 4px;
}

.app-tagline {
    font-size: 1rem;
    color: var(--text-secondary);
    max-width: 420px;
    margin: 0 auto;
    line-height: 1.5;
}

/* Tarjeta Conversora Principal */
.converter-card {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-radius: var(--radius-lg);
    padding: 32px;
    box-shadow: var(--shadow-premium);
    transition: var(--transition-smooth);
}

/* Zona de Arrastrar y Soltar (Drag & Drop) */
.drop-zone {
    border: 2px dashed rgba(255, 255, 255, 0.15);
    border-radius: var(--radius-md);
    padding: 40px 20px;
    text-align: center;
    cursor: pointer;
    transition: var(--transition-smooth);
    background: rgba(255, 255, 255, 0.01);
}

.drop-zone:hover,
.drop-zone.dragover {
    border-color: var(--accent-primary);
    background: rgba(59, 130, 246, 0.05);
    box-shadow: 0 0 20px rgba(59, 130, 246, 0.1);
}

.drop-zone.dragover .upload-icon {
    transform: translateY(-8px);
    color: var(--accent-primary);
}

.drop-zone-content {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.icon-wrapper {
    margin-bottom: 16px;
}

.upload-icon {
    width: 48px;
    height: 48px;
    color: var(--text-secondary);
    transition: var(--transition-smooth);
}

.drop-zone h2 {
    font-family: 'Outfit', sans-serif;
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 8px;
}

.or-divider {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin: 12px 0;
}

.select-btn {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 10px 20px;
    border-radius: var(--radius-md);
    font-weight: 500;
    font-size: 0.9rem;
    cursor: pointer;
    transition: var(--transition-smooth);
}

.select-btn:hover {
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.2);
    transform: translateY(-1px);
}

.hidden-input {
    display: none;
}

/* Panel de Estado del Archivo */
.status-panel {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.file-info {
    display: flex;
    align-items: center;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--card-border);
    padding: 16px;
    border-radius: var(--radius-md);
    gap: 12px;
}

.file-icon {
    font-size: 1.5rem;
}

.file-details {
    display: flex;
    flex-direction: column;
    flex-grow: 1;
    overflow: hidden;
}

.file-name {
    font-weight: 500;
    font-size: 0.95rem;
    white-space: nowrap;
    text-overflow: ellipsis;
    overflow: hidden;
}

.file-size {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.remove-btn {
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 1.5rem;
    cursor: pointer;
    line-height: 1;
    transition: var(--transition-smooth);
    padding: 4px;
}

.remove-btn:hover {
    color: var(--error-color);
    transform: scale(1.1);
}

/* Barra de Progreso */
.progress-container {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.progress-bar-wrapper {
    width: 100%;
    height: 6px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 3px;
    overflow: hidden;
}

.progress-bar {
    width: 0%;
    height: 100%;
    background: var(--accent-gradient);
    border-radius: 3px;
    transition: width 0.3s ease-in-out;
    position: relative;
    overflow: hidden;
}

.progress-bar::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(
        90deg,
        rgba(255, 255, 255, 0) 0%,
        rgba(255, 255, 255, 0.3) 50%,
        rgba(255, 255, 255, 0) 100%
    );
    animation: shimmer 1.5s infinite;
}

@keyframes shimmer {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

.progress-text {
    font-size: 0.85rem;
    color: var(--text-secondary);
    text-align: center;
}

/* Paneles de Resultados (Éxito y Error) */
.result-panel, .error-panel {
    text-align: center;
    padding: 16px 0 8px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    animation: fade-in 0.4s ease-out;
}

.success-icon-wrapper, .error-icon-wrapper {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 8px;
}

.success-icon-wrapper {
    background: var(--success-bg);
    color: var(--success-color);
}

.error-icon-wrapper {
    background: var(--error-bg);
    color: var(--error-color);
}

.success-icon, .error-icon {
    width: 32px;
    height: 32px;
}

.result-panel h3, .error-panel h3 {
    font-family: 'Outfit', sans-serif;
    font-size: 1.4rem;
    font-weight: 600;
}

.result-panel p, .error-panel p {
    font-size: 0.95rem;
    color: var(--text-secondary);
    line-height: 1.6;
    max-width: 360px;
}

/* Botones */
.button-group {
    display: flex;
    flex-direction: column;
    width: 100%;
    gap: 12px;
    margin-top: 8px;
}

.action-btn, .download-btn {
    display: block;
    width: 100%;
    background: var(--accent-gradient);
    color: #fff;
    border: none;
    padding: 14px 28px;
    border-radius: var(--radius-md);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    text-align: center;
    transition: var(--transition-smooth);
    box-shadow: 0 4px 15px rgba(139, 92, 246, 0.2);
}

.action-btn:hover, .download-btn:hover {
    background: var(--accent-hover-gradient);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(139, 92, 246, 0.35);
}

.action-btn:active, .download-btn:active {
    transform: translateY(0);
}

.secondary-btn {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.08);
    color: var(--text-primary);
    padding: 12px 24px;
    border-radius: var(--radius-md);
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition-smooth);
    width: 100%;
}

.secondary-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.15);
}

/* Footer */
.app-footer {
    text-align: center;
    font-size: 0.8rem;
    color: var(--text-secondary);
}

/* Clases de Control de Visibilidad */
.hidden {
    display: none !important;
}

/* Selector de Formato */
.format-selector {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin: 8px 0 16px;
    text-align: left;
}

.format-label {
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-secondary);
}

.format-options {
    display: flex;
    gap: 12px;
    width: 100%;
}

.format-option {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--card-border);
    border-radius: var(--radius-md);
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 500;
    transition: var(--transition-smooth);
}

.format-option input[type="radio"] {
    display: none;
}

.format-option:hover {
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(255, 255, 255, 0.15);
}

.format-option.active {
    background: rgba(59, 130, 246, 0.1);
    border-color: var(--accent-primary);
    box-shadow: 0 0 12px rgba(59, 130, 246, 0.15);
}

/* Selector PDF Específico Activo */
.format-option#option-pdf.active {
    background: rgba(139, 92, 246, 0.1);
    border-color: var(--accent-secondary);
    box-shadow: 0 0 12px rgba(139, 92, 246, 0.15);
}

.format-option.disabled {
    opacity: 0.35;
    cursor: not-allowed;
    background: rgba(255, 255, 255, 0.01) !important;
    border-color: rgba(255, 255, 255, 0.03) !important;
}

.format-option.disabled:hover {
    background: rgba(255, 255, 255, 0.01) !important;
    border-color: rgba(255, 255, 255, 0.03) !important;
}

.format-warning {
    font-size: 0.78rem;
    color: #f59e0b; /* Amarillo ámbar */
    margin-top: 4px;
    line-height: 1.4;
}

/* Colores específicos de Botones de Descarga */
.download-btn.docx-color {
    background: linear-gradient(135deg, #2b6cb0 0%, #1a365d 100%);
    box-shadow: 0 4px 15px rgba(43, 108, 176, 0.2);
}

.download-btn.docx-color:hover {
    background: linear-gradient(135deg, #3182ce 0%, #2a4365 100%);
    box-shadow: 0 6px 20px rgba(43, 108, 176, 0.3);
}

.download-btn.pdf-color {
    background: linear-gradient(135deg, #e53e3e 0%, #9b2c2c 100%);
    box-shadow: 0 4px 15px rgba(229, 62, 62, 0.2);
}

.download-btn.pdf-color:hover {
    background: linear-gradient(135deg, #f56565 0%, #c53030 100%);
    box-shadow: 0 6px 20px rgba(229, 62, 62, 0.35);
}

/* Animaciones */
@keyframes pulse-micro {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

@keyframes fade-in {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

/* --- ESTILOS DE AUTENTICACIÓN Y SAAS --- */

.app-header-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 24px;
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    background: rgba(17, 24, 39, 0.4);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 0 0 16px 16px;
    z-index: 10;
}

.header-logo {
    font-family: 'Outfit', sans-serif;
    font-weight: 700;
    font-size: 1.25rem;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 8px;
}

.google-login-btn {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    background-color: #ffffff;
    color: #3c4043;
    font-family: 'Inter', sans-serif;
    font-weight: 500;
    font-size: 0.85rem;
    padding: 8px 16px;
    border-radius: 8px;
    text-decoration: none;
    transition: background-color 0.2s, box-shadow 0.2s;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1), 0 1px 2px rgba(0, 0, 0, 0.06);
}

.google-login-btn:hover {
    background-color: #f8f9fa;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.08), 0 1px 3px rgba(0, 0, 0, 0.04);
}

.google-icon {
    display: flex;
    align-items: center;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.user-name {
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-primary);
}

.user-plan-badge {
    font-size: 0.7rem;
    font-weight: 700;
    background: linear-gradient(135deg, var(--accent-primary) 0%, var(--accent-secondary) 100%);
    color: #ffffff;
    padding: 3px 8px;
    border-radius: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.logout-link {
    font-size: 0.8rem;
    color: var(--text-secondary);
    text-decoration: none;
    padding: 4px 8px;
    border-radius: 4px;
    transition: background-color 0.2s, color 0.2s;
}

.logout-link:hover {
    background-color: rgba(239, 68, 68, 0.1);
    color: #ef4444;
}

/* Prompt de Login */
.login-prompt-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 32px 16px;
}

.welcome-icon-wrapper {
    font-size: 3rem;
    margin-bottom: 16px;
    animation: pulse-micro 3s infinite ease-in-out;
}

.login-prompt-content h2 {
    font-family: 'Outfit', sans-serif;
    font-size: 1.75rem;
    color: var(--text-primary);
    margin-bottom: 12px;
}

.login-prompt-content p {
    color: var(--text-secondary);
    font-size: 0.95rem;
    line-height: 1.6;
    max-width: 500px;
    margin-bottom: 24px;
}

.prompt-separator {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-bottom: 16px;
    opacity: 0.7;
}

.google-login-btn-large {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    background-color: #ffffff;
    color: #3c4043;
    font-family: 'Outfit', sans-serif;
    font-weight: 600;
    font-size: 1.05rem;
    padding: 12px 28px;
    border-radius: 12px;
    text-decoration: none;
    transition: background-color 0.2s, box-shadow 0.2s, transform 0.2s;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15);
}

.google-login-btn-large:hover {
    background-color: #f8f9fa;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.2);
    transform: translateY(-2px);
}

.google-login-btn-large:active {
    transform: translateY(0);
}
