/* ==========================================================================
   Franjas WEB - Estilos Premium repositorIA
   ========================================================================== */

:root {
    /* Paleta Principal Dark Tech */
    --bg-main: #0B0F19;
    --bg-card: rgba(17, 24, 39, 0.75);
    --bg-card-hover: rgba(30, 41, 59, 0.85);
    --border-color: rgba(255, 255, 255, 0.08);
    --border-glow: rgba(99, 102, 241, 0.35);

    /* Acentos & Gradientes */
    --primary: #6366F1;
    --primary-light: #818CF8;
    --primary-dark: #4F46E5;
    --accent-cyan: #06B6D4;
    --accent-glow: linear-gradient(135deg, #6366F1 0%, #06B6D4 100%);
    --btn-gradient: linear-gradient(135deg, #4F46E5 0%, #0891B2 100%);
    --btn-gradient-hover: linear-gradient(135deg, #4338CA 0%, #0E7490 100%);

    /* Tipografía & Estados */
    --text-pure: #FFFFFF;
    --text-main: #F1F5F9;
    --text-muted: #94A3B8;
    --text-dim: #64748B;
    
    --success: #10B981;
    --success-bg: rgba(16, 185, 129, 0.12);
    --success-border: rgba(16, 185, 129, 0.3);

    --error: #F43F5E;
    --error-bg: rgba(244, 63, 94, 0.12);
    --error-border: rgba(244, 63, 94, 0.3);

    /* Métricas */
    --radius-sm: 8px;
    --radius-md: 14px;
    --radius-lg: 20px;
    --shadow-card: 0 10px 25px -5px rgba(0, 0, 0, 0.5), 0 8px 10px -6px rgba(0, 0, 0, 0.5);
    --shadow-glow: 0 0 35px rgba(99, 102, 241, 0.15);
}

/* Reset y base */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
    background-color: var(--bg-main);
    color: var(--text-main);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    justify-content: center;
    padding: 2.5rem 1.25rem;
    position: relative;
    overflow-x: hidden;
}

/* Fondos ambientales de brillo (ambient mesh glows) */
.glow-bg {
    position: fixed;
    border-radius: 50%;
    filter: blur(120px);
    pointer-events: none;
    z-index: 0;
    opacity: 0.45;
}

.glow-1 {
    top: -10%;
    left: 20%;
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, rgba(99, 102, 241, 0.4) 0%, transparent 70%);
}

.glow-2 {
    bottom: 5%;
    right: 15%;
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, rgba(6, 182, 212, 0.3) 0%, transparent 70%);
}

.glow-3 {
    top: 40%;
    left: -10%;
    width: 450px;
    height: 450px;
    background: radial-gradient(circle, rgba(79, 70, 229, 0.25) 0%, transparent 70%);
}

/* Contenedor principal */
.app-container {
    width: 100%;
    max-width: 860px;
    display: flex;
    flex-direction: column;
    gap: 2.2rem;
    position: relative;
    z-index: 1;
}

/* Header Principal */
.main-header {
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.85rem;
}

.brand-wrapper {
    position: relative;
    padding: 0.5rem;
    display: inline-flex;
    justify-content: center;
    align-items: center;
}

.header-logo {
    max-height: 115px;
    width: auto;
    object-fit: contain;
    filter: drop-shadow(0 0 25px rgba(99, 102, 241, 0.35));
    transition: transform 0.3s ease, filter 0.3s ease;
}

.header-logo:hover {
    transform: scale(1.03);
    filter: drop-shadow(0 0 35px rgba(6, 182, 212, 0.5));
}

.badge-version {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: rgba(99, 102, 241, 0.1);
    border: 1px solid rgba(99, 102, 241, 0.25);
    padding: 0.35rem 0.9rem;
    border-radius: 999px;
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--primary-light);
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.pulse-dot {
    width: 8px;
    height: 8px;
    background-color: var(--accent-cyan);
    border-radius: 50%;
    box-shadow: 0 0 10px var(--accent-cyan);
    animation: pulse 2s infinite ease-in-out;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.4); opacity: 0.6; }
}

.main-title {
    font-size: 2.25rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    color: var(--text-pure);
    background: linear-gradient(180deg, #FFFFFF 0%, #CBD5E1 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.main-subtitle {
    font-size: 1rem;
    color: var(--text-muted);
    max-width: 620px;
    line-height: 1.5;
}

.main-subtitle strong {
    color: var(--text-main);
    font-weight: 600;
}

/* Tarjetas Premium */
.form-wrapper {
    display: flex;
    flex-direction: column;
    gap: 1.6rem;
}

.premium-card {
    background: var(--bg-card);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 1.85rem;
    box-shadow: var(--shadow-card);
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.premium-card:hover {
    border-color: rgba(99, 102, 241, 0.22);
    box-shadow: var(--shadow-card), var(--shadow-glow);
}

.card-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
    padding-bottom: 1.1rem;
    border-bottom: 1px solid var(--border-color);
}

.step-indicator {
    width: 38px;
    height: 38px;
    border-radius: var(--radius-sm);
    background: var(--accent-glow);
    color: white;
    font-weight: 800;
    font-size: 1.1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 14px rgba(99, 102, 241, 0.4);
    flex-shrink: 0;
}

.card-titles h2 {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--text-pure);
    letter-spacing: -0.01em;
}

.card-titles p {
    font-size: 0.85rem;
    color: var(--text-muted);
}

/* Zona de Drop de Archivos */
.file-drop-zone {
    position: relative;
    border: 2px dashed rgba(99, 102, 241, 0.35);
    background: rgba(99, 102, 241, 0.03);
    border-radius: var(--radius-md);
    padding: 2.2rem 1.5rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.25s ease;
}

.file-drop-zone:hover, .file-drop-zone.dragover {
    border-color: var(--accent-cyan);
    background: rgba(6, 182, 212, 0.06);
    box-shadow: 0 0 20px rgba(6, 182, 212, 0.15);
}

.file-drop-zone input[type="file"] {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
    z-index: 5;
}

.drop-zone-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    pointer-events: none;
}

.upload-icon-wrapper {
    width: 58px;
    height: 58px;
    border-radius: 50%;
    background: rgba(99, 102, 241, 0.1);
    border: 1px solid rgba(99, 102, 241, 0.25);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary-light);
    transition: transform 0.25s ease, color 0.25s ease;
}

.file-drop-zone:hover .upload-icon-wrapper {
    transform: translateY(-4px);
    color: var(--accent-cyan);
    border-color: var(--accent-cyan);
}

.upload-svg {
    width: 28px;
    height: 28px;
}

.drop-text-group {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.drop-title {
    font-size: 1.05rem;
    font-weight: 600;
    color: var(--text-pure);
}

.browse-link {
    color: var(--accent-cyan);
    text-decoration: underline;
    text-underline-offset: 4px;
}

.drop-subtitle {
    font-size: 0.82rem;
    color: var(--text-dim);
}

/* Vista de archivo seleccionado */
.file-selected-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: rgba(15, 23, 42, 0.8);
    border: 1px solid rgba(16, 185, 129, 0.3);
    padding: 1rem 1.25rem;
    border-radius: var(--radius-sm);
    z-index: 10;
    position: relative;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.file-info-left {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.file-type-badge {
    background: #10B981;
    color: #064E3B;
    font-weight: 800;
    font-size: 0.75rem;
    padding: 0.35rem 0.6rem;
    border-radius: 6px;
    letter-spacing: 0.05em;
}

.file-details {
    display: flex;
    flex-direction: column;
    text-align: left;
}

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

.file-size {
    font-size: 0.8rem;
    color: var(--text-dim);
    font-family: 'JetBrains Mono', monospace;
}

.btn-remove-file {
    background: transparent;
    border: none;
    color: var(--text-dim);
    cursor: pointer;
    padding: 0.4rem;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.2s, background 0.2s;
}

.btn-remove-file:hover {
    color: var(--error);
    background: rgba(244, 63, 94, 0.1);
}

/* Acordeón de Ejemplo */
.example-accordion {
    margin-top: 1.25rem;
    border: 1px solid var(--border-color);
    background: rgba(15, 23, 42, 0.4);
    border-radius: var(--radius-sm);
    overflow: hidden;
    transition: all 0.2s ease;
}

.example-accordion summary {
    padding: 0.85rem 1.1rem;
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--primary-light);
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.6rem;
    outline: none;
    user-select: none;
}

.example-accordion summary:hover {
    color: var(--accent-cyan);
}

.example-body {
    padding: 1.1rem;
    border-top: 1px solid var(--border-color);
}

.example-note {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 0.85rem;
}

.img-preview-frame {
    border-radius: var(--radius-sm);
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.example-img {
    width: 100%;
    display: block;
}

/* Imagen angosta: se muestra a su tamaño real (sin estirar) y centrada */
.img-preview-frame--centered {
    background: #FFFFFF;
    display: flex;
    justify-content: center;
}

.example-img--natural {
    width: auto;
    max-width: 100%;
    height: auto;
}

/* Form Fields & Grid */
.grid-form-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.25rem;
}

.mt-3 {
    margin-top: 1.25rem;
}

.form-field {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.form-field label {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-main);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.hint-tag {
    font-size: 0.72rem;
    font-weight: 500;
    color: var(--accent-cyan);
}

.color-dot-indicator {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background-color: #EF4444;
    box-shadow: 0 0 8px #EF4444;
    transition: background-color 0.2s, box-shadow 0.2s;
}

/* Inputs y Selects */
.select-wrapper {
    position: relative;
}

.select-wrapper::after {
    content: "";
    position: absolute;
    right: 1.1rem;
    top: 50%;
    transform: translateY(-50%);
    width: 8px;
    height: 8px;
    border-right: 2px solid var(--text-muted);
    border-bottom: 2px solid var(--text-muted);
    rotate: 45deg;
    pointer-events: none;
}

select, .custom-input {
    width: 100%;
    background: rgba(15, 23, 42, 0.7);
    border: 1px solid var(--border-color);
    color: var(--text-pure);
    padding: 0.85rem 1.1rem;
    border-radius: var(--radius-sm);
    font-size: 0.92rem;
    font-family: inherit;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
    appearance: none;
}

select:focus, .custom-input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2);
}

select option {
    background-color: #111827;
    color: var(--text-pure);
}

/* Slider de Opacidad */
.slider-field {
    margin-top: 1.4rem;
}

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

.badge-value {
    background: rgba(6, 182, 212, 0.15);
    border: 1px solid rgba(6, 182, 212, 0.3);
    color: var(--accent-cyan);
    font-size: 0.8rem;
    font-weight: 700;
    font-family: 'JetBrains Mono', monospace;
    padding: 0.2rem 0.6rem;
    border-radius: 6px;
}

.custom-range {
    -webkit-appearance: none;
    width: 100%;
    height: 6px;
    border-radius: 4px;
    background: #1E293B;
    outline: none;
    margin: 0.75rem 0 0.4rem;
}

.custom-range::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--accent-cyan);
    cursor: pointer;
    box-shadow: 0 0 12px var(--accent-cyan);
    transition: transform 0.15s ease;
}

.custom-range::-webkit-slider-thumb:hover {
    transform: scale(1.15);
}

.custom-range::-moz-range-thumb {
    width: 20px;
    height: 20px;
    border: none;
    border-radius: 50%;
    background: var(--accent-cyan);
    cursor: pointer;
    box-shadow: 0 0 12px var(--accent-cyan);
}

.slider-labels {
    display: flex;
    justify-content: space-between;
    font-size: 0.75rem;
    color: var(--text-dim);
}

/* Botonera de Acciones Múltiples */
.actions-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.25rem;
    margin-top: 0.5rem;
    width: 100%;
}

.actions-grid {
    display: grid;
    grid-template-columns: 1fr 1fr 1.2fr;
    gap: 1rem;
    width: 100%;
}

.btn-action-card {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    padding: 1rem 1.15rem;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
    cursor: pointer;
    font-family: inherit;
    text-align: left;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.btn-action-icon {
    width: 42px;
    height: 42px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: transform 0.2s ease;
}

.btn-action-card:hover .btn-action-icon {
    transform: scale(1.08);
}

.btn-action-info {
    display: flex;
    flex-direction: column;
}

.btn-action-title {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--text-pure);
    line-height: 1.2;
}

.btn-action-sub {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 2px;
}

/* Estilo Botón DXF */
.btn-dxf {
    background: linear-gradient(145deg, rgba(30, 41, 59, 0.8) 0%, rgba(15, 23, 42, 0.9) 100%);
    border-color: rgba(99, 102, 241, 0.3);
}

.btn-dxf .btn-action-icon {
    background: rgba(99, 102, 241, 0.15);
    color: var(--primary-light);
    border: 1px solid rgba(99, 102, 241, 0.3);
}

.btn-dxf:hover {
    transform: translateY(-3px);
    border-color: var(--primary-light);
    box-shadow: 0 10px 25px -5px rgba(99, 102, 241, 0.35);
    background: linear-gradient(145deg, rgba(49, 46, 129, 0.4) 0%, rgba(30, 41, 59, 0.9) 100%);
}

/* Estilo Botón KMZ */
.btn-kmz {
    background: linear-gradient(145deg, rgba(30, 41, 59, 0.8) 0%, rgba(15, 23, 42, 0.9) 100%);
    border-color: rgba(6, 182, 212, 0.3);
}

.btn-kmz .btn-action-icon {
    background: rgba(6, 182, 212, 0.15);
    color: var(--accent-cyan);
    border: 1px solid rgba(6, 182, 212, 0.3);
}

.btn-kmz:hover {
    transform: translateY(-3px);
    border-color: var(--accent-cyan);
    box-shadow: 0 10px 25px -5px rgba(6, 182, 212, 0.35);
    background: linear-gradient(145deg, rgba(8, 145, 178, 0.35) 0%, rgba(30, 41, 59, 0.9) 100%);
}

/* Estilo Botón Ambos (ZIP) */
.btn-both {
    background: var(--btn-gradient);
    border-color: rgba(255, 255, 255, 0.15);
}

.btn-both .btn-action-icon {
    background: rgba(255, 255, 255, 0.18);
    color: white;
}

.btn-both .btn-action-sub {
    color: rgba(255, 255, 255, 0.8);
}

.btn-both:hover {
    background: var(--btn-gradient-hover);
    transform: translateY(-3px);
    box-shadow: 0 12px 30px -5px rgba(79, 70, 229, 0.5), 0 0 25px rgba(6, 182, 212, 0.3);
}

.btn-action-card:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none !important;
    filter: grayscale(0.6);
}

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

/* Status Box */
.status-box {
    width: 100%;
    padding: 1rem 1.25rem;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.85rem;
    font-size: 0.92rem;
    font-weight: 500;
    animation: fadeIn 0.3s ease;
}

.status-box.loading {
    background: rgba(99, 102, 241, 0.08);
    border: 1px solid rgba(99, 102, 241, 0.25);
    color: var(--primary-light);
}

.status-box.success {
    background: var(--success-bg);
    border: 1px solid var(--success-border);
    color: var(--success);
}

.status-box.error {
    background: var(--error-bg);
    border: 1px solid var(--error-border);
    color: var(--error);
}

/* Spinner animado */
.spinner-pulse {
    width: 22px;
    height: 22px;
    border: 3px solid rgba(99, 102, 241, 0.2);
    border-left-color: var(--accent-cyan);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(6px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Footer Oficial */
.main-footer {
    margin-top: 1.5rem;
    padding-top: 1.8rem;
    border-top: 1px solid var(--border-color);
}

.footer-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.85rem;
    text-align: center;
}

.copyright {
    color: var(--text-muted);
    font-size: 0.92rem;
    font-weight: 500;
}

.footer-tags {
    display: flex;
    gap: 0.6rem;
}

.footer-badge {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.06);
    color: var(--text-dim);
    font-size: 0.75rem;
    padding: 0.25rem 0.6rem;
    border-radius: 6px;
}

/* Responsividad */
@media (max-width: 680px) {
    body {
        padding: 1.5rem 0.85rem;
    }

    .main-title {
        font-size: 1.8rem;
    }

    .grid-form-2 {
        grid-template-columns: 1fr;
    }

    .premium-card {
        padding: 1.35rem;
    }
}
