/* Hojas de Estilo - PromoScreenTV (Diseño Premium Dark Mode) */

:root {
    --bg-base: #090d16;
    --bg-surface: #121926;
    --bg-surface-elevated: #1a2333;
    --text-main: #f3f4f6;
    --text-muted: #9ca3af;
    --primary: #6366f1;
    --primary-hover: #4f46e5;
    --primary-gradient: linear-gradient(135deg, #6366f1, #4f46e5);
    --secondary: #10b981;
    --secondary-gradient: linear-gradient(135deg, #10b981, #059669);
    --danger: #ef4444;
    --warning: #f59e0b;
    --border: rgba(255, 255, 255, 0.08);
    --font-heading: 'Outfit', sans-serif;
    --font-body: 'Plus Jakarta Sans', sans-serif;
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.15);
    --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.25);
    --shadow-lg: 0 16px 48px rgba(0, 0, 0, 0.4);
    --radius-sm: 8px;
    --radius-md: 16px;
    --radius-lg: 24px;
}

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

html {
    scroll-behavior: smooth;
}

body {
    background-color: var(--bg-base);
    color: var(--text-main);
    font-family: var(--font-body);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 {
    font-family: var(--font-heading);
    font-weight: 700;
    color: #ffffff;
    line-height: 1.2;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
}

/* NAVBAR */
.navbar {
    background: rgba(9, 13, 22, 0.8);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 100;
    height: 72px;
}

.navbar-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 100%;
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    font-family: var(--font-heading);
    font-size: 24px;
    font-weight: 800;
    color: #ffffff;
    text-decoration: none;
}

.logo-icon {
    color: var(--primary);
    filter: drop-shadow(0 0 8px rgba(99, 102, 241, 0.4));
}

.logo span span {
    color: var(--primary);
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 24px;
}

.nav-links a {
    color: var(--text-muted);
    text-decoration: none;
    font-size: 15px;
    font-weight: 500;
    transition: color 0.2s;
}

.nav-links a:hover {
    color: #ffffff;
}

/* BOTONES */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 20px;
    border-radius: var(--radius-sm);
    font-family: var(--font-body);
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    border: none;
    text-decoration: none;
}

.btn-lg {
    padding: 14px 28px;
    font-size: 16px;
    border-radius: var(--radius-sm);
}

.btn-sm {
    padding: 6px 12px;
    font-size: 13px;
}

.btn-primary {
    background: var(--primary-gradient);
    color: #ffffff;
    box-shadow: 0 4px 14px rgba(99, 102, 241, 0.3);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(99, 102, 241, 0.5);
    background: linear-gradient(135deg, #7c7ffd, #6366f1);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.05);
    color: #ffffff;
    border: 1px solid var(--border);
}

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

.btn-outline {
    background: transparent;
    color: #ffffff;
    border: 1px solid var(--border);
}

.btn-outline:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.2);
}

.btn-block {
    display: flex;
    width: 100%;
}

/* HERO SECTION */
.hero {
    position: relative;
    padding: 80px 0;
    overflow: hidden;
}

.hero-overlay {
    position: absolute;
    top: -20%;
    left: 50%;
    transform: translateX(-50%);
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, rgba(99, 102, 241, 0.15) 0%, rgba(9, 13, 22, 0) 70%);
    pointer-events: none;
    z-index: 0;
}

.hero-container {
    display: grid;
    grid-template-columns: 1.1fr 0.9fr;
    gap: 48px;
    align-items: center;
    position: relative;
    z-index: 1;
}

.hero-content {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.badge {
    align-self: flex-start;
    background: rgba(99, 102, 241, 0.15);
    color: var(--primary);
    border: 1px solid rgba(99, 102, 241, 0.3);
    padding: 6px 12px;
    border-radius: 50px;
    font-size: 13px;
    font-weight: 600;
}

.hero h1 {
    font-size: 48px;
    letter-spacing: -1px;
}

.hero p {
    font-size: 18px;
    color: var(--text-muted);
}

.hero-actions {
    display: flex;
    gap: 16px;
    margin-top: 10px;
}

/* MOCK TV */
.hero-visual {
    display: flex;
    justify-content: center;
    align-items: center;
}

.mock-tv-frame {
    width: 100%;
    max-width: 440px;
    background: #111827;
    border: 12px solid #1f2937;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    position: relative;
}

.mock-tv-frame.vertical {
    border-width: 10px 8px;
}

.mock-tv-screen {
    width: 100%;
    aspect-ratio: 16/9;
    overflow: hidden;
    position: relative;
    background: #000;
}

.mock-tv-carousel {
    width: 100%;
    height: 100%;
}

.mock-slide {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    padding: 24px;
}

.mock-slide h3 {
    font-size: 28px;
    color: #fbbf24;
    margin-bottom: 8px;
}

.mock-slide p {
    font-size: 15px;
    color: #ffffff;
    margin-bottom: 12px;
}

.mock-slide .price {
    font-size: 24px;
    font-weight: 800;
    background: #e11d48;
    color: #fff;
    padding: 4px 16px;
    border-radius: 50px;
}

.mock-tv-badge {
    position: absolute;
    bottom: 8px;
    right: 8px;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    color: #10b981;
    font-size: 11px;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: 4px;
    border: 1px solid rgba(16, 185, 129, 0.3);
}

.mock-tv-stand {
    width: 80px;
    height: 24px;
    background: #1f2937;
    margin: 0 auto -20px auto;
    border-radius: 0 0 8px 8px;
}

/* CARACTERISTICAS */
.features {
    padding: 80px 0;
    background: rgba(255, 255, 255, 0.01);
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
}

.section-title {
    text-align: center;
    max-width: 600px;
    margin: 0 auto 48px auto;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.section-title h2 {
    font-size: 36px;
}

.section-title p {
    color: var(--text-muted);
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 24px;
}

.feature-card {
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 32px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    transition: transform 0.2s, border-color 0.2s;
}

.feature-card:hover {
    transform: translateY(-4px);
    border-color: rgba(99, 102, 241, 0.3);
}

.feature-icon {
    width: 48px;
    height: 48px;
    background: rgba(99, 102, 241, 0.1);
    color: var(--primary);
    border-radius: var(--radius-sm);
    display: flex;
    justify-content: center;
    align-items: center;
}

.feature-card p {
    color: var(--text-muted);
    font-size: 15px;
}

/* PRICING */
.pricing {
    padding: 80px 0;
}

.pricing-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
}

.pricing-card {
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    position: relative;
    transition: transform 0.2s, border-color 0.2s;
}

.pricing-card:hover {
    transform: translateY(-4px);
}

.pricing-card.featured {
    border-color: var(--primary);
    background: var(--bg-surface-elevated);
    box-shadow: var(--shadow-md);
}

.popular-tag {
    position: absolute;
    top: -12px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--primary);
    color: #ffffff;
    font-size: 11px;
    font-weight: 700;
    padding: 4px 12px;
    border-radius: 50px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.pricing-card h3 {
    font-size: 20px;
}

.pricing-card .price {
    font-size: 32px;
    font-weight: 800;
    color: #ffffff;
}

.pricing-card .price span {
    font-size: 14px;
    color: var(--text-muted);
    font-weight: 400;
}

.plan-desc {
    font-size: 14px;
    color: var(--text-muted);
}

.plan-features {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 10px;
    font-size: 14px;
    margin: 8px 0;
}

.plan-features li {
    display: flex;
    align-items: center;
    gap: 8px;
}

.check-icon {
    width: 16px;
    height: 16px;
    color: var(--secondary);
    flex-shrink: 0;
}

/* FOOTER */
.footer {
    border-top: 1px solid var(--border);
    padding: 40px 0;
    background: var(--bg-base);
}

.footer-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 14px;
    color: var(--text-muted);
}

.footer-links {
    display: flex;
    gap: 20px;
}

.footer-links a {
    color: var(--text-muted);
    text-decoration: none;
}

.footer-links a:hover {
    color: #ffffff;
}

/* MODAL DE AUTENTICACION */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(9, 13, 22, 0.85);
    backdrop-filter: blur(8px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.modal-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

.modal-card {
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    width: 100%;
    max-width: 400px;
    padding: 32px;
    position: relative;
    box-shadow: var(--shadow-lg);
    transform: translateY(20px);
    transition: transform 0.3s ease;
}

.modal-overlay.active .modal-card {
    transform: translateY(0);
}

.modal-close {
    position: absolute;
    top: 16px;
    right: 16px;
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 24px;
    cursor: pointer;
}

.modal-close:hover {
    color: #ffffff;
}

.modal-tabs {
    display: flex;
    border-bottom: 1px solid var(--border);
    margin-bottom: 24px;
}

.modal-tab {
    flex: 1;
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-family: var(--font-heading);
    font-size: 16px;
    font-weight: 600;
    padding: 10px 0;
    cursor: pointer;
    border-bottom: 2px solid transparent;
    text-align: center;
}

.modal-tab.active {
    color: var(--primary);
    border-bottom-color: var(--primary);
}

.auth-form {
    display: none;
    flex-direction: column;
    gap: 16px;
}

.auth-form.active {
    display: flex;
}

/* FORMULARIOS */
.form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.form-group label {
    font-size: 14px;
    font-weight: 600;
    color: #ffffff;
}

.form-group input, 
.form-group select {
    background: var(--bg-surface-elevated);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 10px 14px;
    color: #ffffff;
    font-family: var(--font-body);
    font-size: 14px;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.form-group input:focus, 
.form-group select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.25);
}

.form-error {
    color: var(--danger);
    font-size: 13px;
    font-weight: 500;
}

/* --- DASHBOARD STYLES --- */
.dashboard-body {
    background-color: #0b0f19;
}

.db-navbar {
    background: #0f1322;
}

.user-menu {
    display: flex;
    align-items: center;
    gap: 16px;
}

.user-email {
    font-size: 14px;
    color: var(--text-muted);
}

.db-content {
    padding-top: 32px;
    padding-bottom: 60px;
}

.db-grid {
    display: grid;
    grid-template-columns: 360px 1fr;
    gap: 32px;
    align-items: start;
}

.db-card {
    background: rgba(22, 30, 49, 0.5);
    backdrop-filter: blur(16px);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 24px;
    margin-bottom: 24px;
    display: flex;
    flex-direction: column;
    gap: 18px;
    box-shadow: var(--shadow-sm);
}

.db-card h3 {
    font-size: 18px;
    margin-bottom: 4px;
}

/* Enlace TV Widget */
.copy-input-group {
    display: flex;
    gap: 8px;
}

.copy-input-group input {
    flex: 1;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border);
    padding: 8px 12px;
    border-radius: var(--radius-sm);
    color: var(--text-muted);
    font-family: var(--font-body);
    font-size: 13px;
}

.copy-input-group input:focus {
    outline: none;
}

/* Autosave settings UI */
.card-header {
    display: flex;
    justify-content: justify-content;
    align-items: center;
    justify-content: space-between;
}

.save-status {
    font-size: 12px;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 4px;
    background: rgba(16, 185, 129, 0.15);
    color: var(--secondary);
    transition: all 0.2s;
}

.save-status.saving {
    background: rgba(245, 158, 11, 0.15);
    color: var(--warning);
}

.save-status.saved {
    background: rgba(16, 185, 129, 0.15);
    color: var(--secondary);
}

.save-status.error {
    background: rgba(239, 68, 68, 0.15);
    color: var(--danger);
}

/* Custom range slider */
input[type="range"] {
    -webkit-appearance: none;
    width: 100%;
    height: 6px;
    border-radius: 5px;
    background: var(--bg-surface-elevated);
    outline: none;
}

input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: var(--primary);
    cursor: pointer;
    box-shadow: 0 0 8px rgba(99, 102, 241, 0.8);
    transition: transform 0.1s;
}

input[type="range"]::-webkit-slider-thumb:hover {
    transform: scale(1.2);
}

/* Radio Tiles for Fit Option */
.radio-toggle-group {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    background: var(--bg-surface-elevated);
    padding: 4px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
}

.radio-tile {
    cursor: pointer;
    text-align: center;
}

.radio-tile input {
    display: none;
}

.radio-tile .radio-label {
    display: block;
    padding: 8px 4px;
    font-size: 11px;
    font-weight: 700;
    color: var(--text-muted);
    border-radius: 4px;
    transition: all 0.2s;
}

.radio-tile input:checked + .radio-label {
    background: var(--primary);
    color: #ffffff;
    box-shadow: var(--shadow-sm);
}

/* Switch (Reloj) */
.switch-container {
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    user-select: none;
}

.switch-container input {
    display: none;
}

.switch-slider {
    position: relative;
    width: 38px;
    height: 20px;
    background: var(--bg-surface-elevated);
    border-radius: 100px;
    border: 1px solid var(--border);
    transition: background 0.3s;
}

.switch-slider::before {
    content: "";
    position: absolute;
    height: 14px;
    width: 14px;
    left: 2px;
    bottom: 2px;
    background-color: var(--text-muted);
    border-radius: 50%;
    transition: transform 0.3s, background-color 0.3s;
}

.switch-container input:checked + .switch-slider {
    background: var(--primary);
}

.switch-container input:checked + .switch-slider::before {
    transform: translateX(18px);
    background-color: #ffffff;
}

.switch-label {
    font-size: 13px;
    color: var(--text-muted);
}

/* Billing card */
.plan-status-badge {
    align-self: flex-start;
    font-size: 12px;
    font-weight: 700;
    padding: 4px 10px;
    border-radius: 50px;
    text-transform: uppercase;
}

.plan-free {
    background: rgba(255, 255, 255, 0.08);
    color: var(--text-muted);
}

.plan-basic {
    background: rgba(99, 102, 241, 0.15);
    color: var(--primary);
}

.plan-standard {
    background: rgba(16, 185, 129, 0.15);
    color: var(--secondary);
}

.plan-premium {
    background: rgba(245, 158, 11, 0.15);
    color: var(--warning);
}

.billing-info {
    font-size: 13px;
    color: var(--text-muted);
}

.upgrade-actions {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

/* Alerts */
.alert {
    display: flex;
    gap: 16px;
    padding: 16px 20px;
    border-radius: var(--radius-sm);
    margin-bottom: 24px;
    font-size: 14px;
}

.alert-success {
    background: rgba(16, 185, 129, 0.1);
    border: 1px solid rgba(16, 185, 129, 0.2);
    color: #a7f3d0;
}

.alert-success .alert-icon {
    color: var(--secondary);
    font-weight: 800;
}

.alert-warning {
    background: rgba(245, 158, 11, 0.1);
    border: 1px solid rgba(245, 158, 11, 0.2);
    color: #fde68a;
}

.alert-warning .alert-icon {
    color: var(--warning);
    font-weight: 800;
}

/* main area: Gallery */
.gallery-card {
    margin-bottom: 0;
}

.gallery-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--border);
    padding-bottom: 16px;
}

.image-counter {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-muted);
}

.image-counter span {
    color: #ffffff;
}

/* drag drop zone */
.drag-drop-zone {
    border: 2px dashed var(--border);
    background: rgba(255, 255, 255, 0.01);
    border-radius: var(--radius-sm);
    padding: 32px;
    text-align: center;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    transition: all 0.2s ease;
}

.drag-drop-zone:hover, 
.drag-drop-zone.dragover {
    border-color: var(--primary);
    background: rgba(99, 102, 241, 0.03);
}

.upload-icon {
    color: var(--text-muted);
}

.drag-drop-zone:hover .upload-icon, 
.drag-drop-zone.dragover .upload-icon {
    color: var(--primary);
}

.file-select-trigger {
    color: var(--primary);
    text-decoration: underline;
    font-weight: 600;
}

.file-specs {
    font-size: 12px;
    color: var(--text-muted);
}

/* Spinner */
.spinner {
    width: 32px;
    height: 32px;
    border: 3px solid rgba(255, 255, 255, 0.1);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 1s infinite linear;
}

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

/* Images list */
.images-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 16px;
    margin-top: 24px;
}

.no-images-msg {
    grid-column: 1 / -1;
    text-align: center;
    padding: 48px;
    color: var(--text-muted);
    font-size: 15px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: rgba(255, 255, 255, 0.01);
}

.image-card {
    background: var(--bg-surface-elevated);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: border-color 0.2s, box-shadow 0.2s, opacity 0.3s;
}

.image-card:hover {
    border-color: rgba(255, 255, 255, 0.15);
    box-shadow: var(--shadow-sm);
}

.img-preview {
    width: 100%;
    aspect-ratio: 16/9;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    position: relative;
}

.img-info {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 12px;
    gap: 8px;
}

.img-name {
    font-size: 12px;
    color: #ffffff;
    font-weight: 500;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.btn-delete {
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 20px;
    cursor: pointer;
    line-height: 1;
    padding: 2px;
}

.btn-delete:hover {
    color: var(--danger);
}

/* Frozen state (imagen excedente) */
.image-card.frozen {
    border-color: rgba(245, 158, 11, 0.2);
}

.image-card.frozen .img-preview {
    filter: grayscale(100%);
    opacity: 0.5;
}

.frozen-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    justify-content: center;
    align-items: center;
}

.frozen-overlay span {
    background: var(--warning);
    color: #000;
    font-size: 10px;
    font-weight: 800;
    padding: 3px 8px;
    border-radius: 4px;
    text-transform: uppercase;
}

/* Toast */
.toast {
    position: fixed;
    bottom: 24px;
    right: 24px;
    background: var(--bg-surface-elevated);
    border: 1px solid var(--secondary);
    color: #ffffff;
    padding: 12px 24px;
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-md);
    font-size: 14px;
    font-weight: 600;
    opacity: 0;
    transform: translateY(10px);
    pointer-events: none;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 2000;
}

.toast.active {
    opacity: 1;
    transform: translateY(0);
}

/* RESPONSIVE */
@media (max-width: 900px) {
    .db-grid {
        grid-template-columns: 1fr;
    }
    
    .hero-container {
        grid-template-columns: 1fr;
        text-align: center;
    }
    
    .badge {
        align-self: center;
    }
    
    .hero-actions {
        justify-content: center;
    }
    
    .features-grid {
        grid-template-columns: 1fr;
    }
    
    .pricing-grid {
        grid-template-columns: 1fr 1fr;
    }
    
    .nav-links {
        display: none; /* Simplificado para móviles */
    }
}

@media (max-width: 600px) {
    .pricing-grid {
        grid-template-columns: 1fr;
    }
}
