/* ============================================
   TINYPRESS - ESTILOS REDISEÑADOS
   ============================================ */

:root {
    --bg: #0f172a;
    --surface: #1e293b;
    --surface-light: #334155;
    --primary: #6366f1;
    --primary-hover: #818cf8;
    --accent: #22d3ee;
    --text: #f1f5f9;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    --border: #334155;
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.3);
    --shadow-md: 0 4px 12px rgba(0,0,0,0.4);
    --shadow-lg: 0 10px 30px rgba(0,0,0,0.5);
    --radius-sm: 10px;
    --radius: 14px;
    --radius-lg: 18px;
    --transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    --font: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
}

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

body {
    font-family: var(--font);
    background: radial-gradient(ellipse at 50% 0%, #1e293b 0%, #0f172a 60%);
    color: var(--text);
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 20px;
    -webkit-font-smoothing: antialiased;
}

/* ===== CONTENEDOR PRINCIPAL ===== */
.app-container {
    width: 100%;
    max-width: 440px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
}

/* ===== LOGO ===== */
.logo-area {
    text-align: center;
}

.logo-img {
    height: 40px;
    filter: drop-shadow(0 0 12px rgba(99, 102, 241, 0.4));
    transition: var(--transition);
}

.logo-img:hover {
    filter: drop-shadow(0 0 20px rgba(99, 102, 241, 0.7));
}

/* ===== TÍTULO ===== */
.app-title {
    font-size: 1.8rem;
    font-weight: 700;
    background: linear-gradient(135deg, #6366f1, #22d3ee);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: -0.5px;
}

.app-subtitle {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-top: -8px;
}

/* ===== CARD PRINCIPAL ===== */
.main-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 24px 20px;
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 18px;
    box-shadow: var(--shadow-lg);
}

/* ===== ÁREA DE SUBIDA ===== */
.upload-area {
    border: 2px dashed var(--border);
    border-radius: var(--radius);
    padding: 30px 20px;
    text-align: center;
    cursor: pointer;
    transition: var(--transition);
    background: rgba(99, 102, 241, 0.02);
}

.upload-area:hover {
    border-color: var(--primary);
    background: rgba(99, 102, 241, 0.05);
}

.upload-icon {
    font-size: 2.2rem;
    margin-bottom: 8px;
}

.upload-text {
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--text);
}

.upload-hint {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 4px;
}

/* ===== PREVIEW ===== */
.preview-box,
.result-box {
    background: rgba(0, 0, 0, 0.25);
    border-radius: var(--radius);
    padding: 14px;
    border: 1px solid var(--border);
}

.preview-header,
.result-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

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

.result-label {
    font-weight: 600;
    font-size: 0.85rem;
    color: #4ade80;
}

.preview-size,
.result-size {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.preview-img,
.result-img {
    width: 100%;
    max-height: 200px;
    object-fit: contain;
    border-radius: var(--radius-sm);
    display: block;
    margin: 0 auto;
}

/* ===== CONTROL DE CALIDAD ===== */
.quality-control {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.quality-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

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

#qualityValue {
    font-weight: 700;
    color: var(--primary-hover);
    font-size: 0.9rem;
}

input[type="range"] {
    width: 100%;
    accent-color: var(--primary);
    height: 6px;
}

.quality-labels {
    display: flex;
    justify-content: space-between;
    font-size: 0.6rem;
    color: var(--text-muted);
}

/* ===== SELECTOR DE FORMATO ===== */
.format-selector {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

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

.format-selector select {
    padding: 10px 14px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    background: rgba(0, 0, 0, 0.3);
    color: var(--text);
    font-family: var(--font);
    font-size: 0.85rem;
    cursor: pointer;
    transition: var(--transition);
}

.format-selector select:focus {
    outline: none;
    border-color: var(--primary);
}

.format-selector select option {
    background: var(--surface);
    color: var(--text);
}

/* ===== BOTÓN COMPRIMIR ===== */
.btn-compress {
    width: 100%;
    padding: 14px;
    border: none;
    border-radius: var(--radius);
    background: linear-gradient(135deg, #6366f1, #4f46e5);
    color: white;
    font-family: var(--font);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    box-shadow: 0 4px 15px rgba(99, 102, 241, 0.3);
}

.btn-compress:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(99, 102, 241, 0.4);
}

.btn-compress:active {
    transform: scale(0.97);
}

.btn-icon {
    font-size: 1.2rem;
}

/* ===== RESULTADO ===== */
.result-stats {
    text-align: center;
    font-size: 0.8rem;
    color: #4ade80;
    font-weight: 600;
    margin: 6px 0;
}

.btn-download {
    width: 100%;
    padding: 12px;
    border: 2px solid #4ade80;
    border-radius: var(--radius);
    background: rgba(74, 222, 128, 0.08);
    color: #4ade80;
    font-family: var(--font);
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: 8px;
}

.btn-download:hover {
    background: rgba(74, 222, 128, 0.15);
    transform: translateY(-2px);
}

/* ===== FOOTER MARCA ===== */
.brand-footer {
    text-align: center;
    padding: 8px 0;
}

.brand-footer p {
    font-size: 0.7rem;
    color: var(--text-muted);
    margin: 0;
}

.brand-footer a {
    color: var(--primary-hover);
    text-decoration: none;
    font-weight: 500;
    transition: var(--transition);
}

.brand-footer a:hover {
    color: var(--accent);
}

.footer-logo {
    height: 14px;
    vertical-align: middle;
    opacity: 0.5;
    margin-right: 4px;
}

/* ===== UTILIDADES ===== */
.hidden {
    display: none !important;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 480px) {
    .app-container {
        max-width: 100%;
    }

    .main-card {
        padding: 18px 14px;
    }

    .app-title {
        font-size: 1.5rem;
    }

    .btn-compress {
        padding: 12px;
        font-size: 0.9rem;
    }
}