/* Postulaciones Públicas - Estilos */

/* ── Sección de postulaciones cerradas ── */
.closed-section {
    margin-top: 1rem;
    margin-bottom: 3rem;
}

.closed-section-title {
    display: flex !important;
    flex-direction: row !important;
    align-items: center;
    gap: 0.6rem;
    color: rgba(255, 255, 255, 0.3);
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-bottom: 1rem;
}

.closed-section-title i {
    font-size: 0.7rem;
}

/* Lista de filas cerradas */
.closed-cards-list {
    display: flex !important;
    flex-direction: column !important;
    gap: 0.5rem;
    width: 100%;
}

/* Cada fila cerrada */
.closed-card {
    display: grid !important;
    grid-template-columns: 64px 1fr auto !important;
    align-items: center !important;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 0.75rem;
    overflow: hidden;
    transition: background 0.2s ease, border-color 0.2s ease;
    min-height: 64px;
}

.closed-card:hover {
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(255, 255, 255, 0.14);
}

/* Cuadro de color izquierdo con icono */
.closed-card__stripe {
    width: 64px !important;
    height: 100% !important;
    min-height: 64px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    font-size: 1.3rem;
    color: rgba(255, 255, 255, 0.85);
    opacity: 0.5;
    filter: saturate(0.5) brightness(0.7);
    flex-shrink: 0 !important;
}

/* Columna de texto central */
.closed-card__body {
    padding: 0.65rem 1rem;
    min-width: 0;
    overflow: hidden;
}

.closed-card__name {
    font-size: 0.9rem;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.52);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.closed-card__desc {
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.27);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    margin-top: 0.1rem;
}

/* Botón y badge a la derecha */
.closed-card__actions {
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    gap: 0.75rem;
    padding: 0 1rem;
    white-space: nowrap;
}

.closed-badge {
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: rgba(255, 255, 255, 0.22);
    display: flex !important;
    align-items: center;
    gap: 0.3rem;
    white-space: nowrap;
}

.btn-sm {
    padding: 0.35rem 0.9rem !important;
    font-size: 0.75rem !important;
}

.applications-section {
    min-height: calc(100vh - 100px);
    padding: 8rem 2rem 4rem;
}

.applications-header {
    text-align: center;
    margin-bottom: 4rem;
}

.applications-header h1 {
    font-size: 3rem;
    margin-bottom: 1rem;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.applications-header p {
    font-size: 1.25rem;
    color: var(--gray);
}

/* Grid de Postulaciones Públicas */
.applications-public-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 2rem;
    margin-bottom: 3rem;
}

/* Card de Postulación Pública */
.application-public-card {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 1rem;
    border: 1px solid rgba(255, 255, 255, 0.1);
    overflow: hidden;
    transition: all 0.3s ease;
    position: relative;
    display: flex;
    flex-direction: column;
}

.application-public-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.3);
    border-color: rgba(255, 255, 255, 0.2);
}


/* Badge de Estado (Top-Right) */
.status-badge {
    position: absolute;
    top: 1rem;
    right: 1rem;
    padding: 0.5rem 0.875rem;
    border-radius: 0.5rem;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    z-index: 10;
    backdrop-filter: blur(10px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.status-indicator {
    width: 10px;
    height: 10px;
    border-radius: 50%;
}

/* Badge Abierta (Verde con animación) */
.status-badge.status-active {
    background: #10B981;
    border: none;
    color: white;
    font-weight: 800;
}

.status-badge.status-active .status-indicator {
    background: white;
}

@keyframes pulse-animation {
    0%, 100% {
        transform: scale(1);
        opacity: 1;
    }
    50% {
        transform: scale(1.3);
        opacity: 0.7;
    }
}

.status-indicator.pulse {
    animation: pulse-animation 2s ease-in-out infinite;
}

/* Badge Programada (Naranja con animación) */
.status-badge.status-scheduled {
    background: #FF9C2B;
    border: none;
    color: white;
    font-weight: 800;
}

.status-badge.status-scheduled .status-indicator {
    background: white;
}

@keyframes scheduled-pulse {
    0%, 100% {
        opacity: 0.4;
    }
    50% {
        opacity: 1;
    }
}

.status-indicator.scheduled-pulse {
    animation: scheduled-pulse 1.5s ease-in-out infinite;
}

/* Badge Cerrada (Gris) */
.status-badge.status-closed {
    background: #6B7280;
    border: none;
    color: white;
    font-weight: 800;
}

.status-badge.status-closed .status-indicator {
    background: white;
}

/* Header de la Card */
.application-public-header {
    padding: 3rem 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.application-public-icon {
    width: 80px;
    height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 1rem;
    font-size: 2.5rem;
    color: white;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.3);
}

/* Body de la Card */
.application-public-body {
    padding: 2rem;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.application-public-body h2 {
    font-size: 1.75rem;
    margin: 0;
    color: var(--light);
}

.application-public-body .description {
    color: #C4C4C4;
    font-size: 0.95rem;
    line-height: 1.6;
    margin: 0;
}

/* Requisitos */
.requirements {
    background: rgba(255, 255, 255, 0.03);
    padding: 1rem;
    border-radius: 0.5rem;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.requirements h3 {
    font-size: 1rem;
    margin: 0 0 0.75rem 0;
    color: var(--primary);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.requirements ul {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.requirements li {
    color: #C4C4C4;
    font-size: 0.875rem;
    padding-left: 1.5rem;
    position: relative;
}

.requirements li::before {
    content: "•";
    position: absolute;
    left: 0;
    color: var(--primary);
    font-weight: bold;
}

/* Información Adicional */
.application-info {
    display: flex;
    gap: 1.5rem;
    padding-top: 1rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.info-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    color: #C4C4C4;
}

.info-item i {
    color: var(--primary);
}

/* Footer de la Card */
.application-public-footer {
    padding: 1.5rem 2rem;
    background: rgba(0, 0, 0, 0.3);
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.btn-block {
    width: 100%;
    text-align: center;
    justify-content: center;
}

/* Tiempo Restante (Activas) */
.time-remaining {
    text-align: center;
    padding: 0.75rem;
    background: rgba(255, 156, 43, 0.1);
    border-radius: 0.5rem;
    color: var(--warning);
    font-size: 0.875rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

/* Información de Programadas */
.scheduled-info {
    text-align: center;
    padding: 1rem;
    background: rgba(255, 156, 43, 0.1);
    border-radius: 0.5rem;
    margin-bottom: 0.5rem;
}

.scheduled-info p {
    margin: 0 0 0.5rem 0;
    color: var(--warning);
    font-size: 0.875rem;
}

.countdown-large {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--warning);
    font-family: 'Courier New', monospace;
}

/* Mensaje de Cerrada */
.closed-message {
    text-align: center;
    padding: 1rem;
    background: rgba(107, 114, 128, 0.1);
    border-radius: 0.5rem;
    margin-bottom: 0.5rem;
}

.closed-message i {
    font-size: 2rem;
    color: var(--gray);
    margin-bottom: 0.5rem;
}

.closed-message p {
    margin: 0;
    color: var(--gray);
    font-size: 0.875rem;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 4rem 2rem;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 1rem;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.empty-state i {
    font-size: 5rem;
    color: var(--gray);
    opacity: 0.3;
    margin-bottom: 1.5rem;
}

.empty-state h2 {
    font-size: 2rem;
    margin-bottom: 1rem;
}

.empty-state p {
    color: var(--gray);
    margin-bottom: 2rem;
}

/* Utility Classes */
.section-card {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 1rem;
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 2rem;
}

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

/* ===== APPLICATION FORM STYLES ===== */

/* Ocultar partículas — demasiado distractor en un formulario */
.particles { display: none; }

.form-application {
    max-width: 860px;
    margin: 0 auto;
}

/* ── Timer ─────────────────────────────────────────────────────── */
.timer-bar {
    position: sticky;
    top: 80px;
    background: rgba(129, 71, 242, 0.07);
    border: 1px solid rgba(129, 71, 242, 0.3);
    border-radius: 10px;
    padding: 0.875rem 1.25rem;
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    backdrop-filter: blur(12px);
    z-index: 100;
}

.timer-bar.warning {
    background: rgba(255, 156, 43, 0.07);
    border-color: rgba(255, 156, 43, 0.35);
}

.timer-bar.danger {
    background: rgba(239, 68, 68, 0.07);
    border-color: rgba(239, 68, 68, 0.35);
    animation: pulse-border 1s ease-in-out infinite;
}

@keyframes pulse-border {
    0%, 100% { border-color: rgba(239, 68, 68, 0.35); }
    50%       { border-color: rgba(255, 156, 43, 0.45); }
}

.timer-display {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 1.1rem;
    font-weight: 700;
}

.timer-bar-note {
    color: rgba(255, 255, 255, 0.4);
    font-size: 0.8rem;
}

/* ── Question cards ────────────────────────────────────────────── */
.form-question {
    margin-bottom: 1rem;
    padding: 1.5rem 1.75rem;
    background: rgba(255, 255, 255, 0.025);
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.07);
    transition: border-color 0.2s, background 0.2s;
}

.form-question:focus-within {
    background: rgba(255, 255, 255, 0.04);
    border-color: rgba(129, 71, 242, 0.3);
}

.question-label {
    display: flex;
    align-items: baseline;
    gap: 0.625rem;
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 1rem;
    color: var(--light);
    line-height: 1.5;
}

.question-label .required {
    color: #EF4444;
    margin-left: 2px;
}

.question-description {
    color: rgba(255, 255, 255, 0.45);
    font-size: 0.85rem;
    margin-bottom: 1rem;
    margin-top: -0.5rem;
    line-height: 1.5;
}

/* ── Inputs ────────────────────────────────────────────────────── */
.form-input,
.form-textarea {
    width: 100%;
    padding: 0.8125rem 1rem;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    color: var(--light);
    font-family: inherit;
    font-size: 0.9375rem;
    transition: border-color 0.2s, background 0.2s, box-shadow 0.2s;
}

.form-textarea {
    min-height: 120px;
    resize: vertical;
}

.form-input:focus,
.form-textarea:focus {
    outline: none;
    border-color: rgba(129, 71, 242, 0.55);
    background: rgba(255, 255, 255, 0.06);
    box-shadow: 0 0 0 3px rgba(129, 71, 242, 0.07);
}

.form-input::placeholder,
.form-textarea::placeholder {
    color: rgba(255, 255, 255, 0.28);
}

/* ── Select nativo oculto (sustituido por .lux-select) ────────── */
.custom-select-wrapper {
    position: relative;
}

select.form-input {
    display: none; /* ocultado — el custom dropdown toma su lugar */
}

/* ── Custom Dropdown (lux-select) ──────────────────────────────── */
.lux-select {
    position: relative;
    width: 100%;
    user-select: none;
    font-family: inherit;
}

.lux-select__trigger {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    width: 100%;
    padding: 0.8125rem 1rem;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    color: var(--light);
    font-size: 0.9375rem;
    cursor: pointer;
    transition: border-color 0.2s, background 0.2s, box-shadow 0.2s;
    outline: none;
}

.lux-select__trigger:hover {
    border-color: rgba(255, 255, 255, 0.2);
    background: rgba(255, 255, 255, 0.06);
}

.lux-select.open .lux-select__trigger,
.lux-select__trigger:focus {
    border-color: rgba(129, 71, 242, 0.55);
    background: rgba(255, 255, 255, 0.06);
    box-shadow: 0 0 0 3px rgba(129, 71, 242, 0.07);
}

.lux-select__value {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.lux-select__value.placeholder {
    color: rgba(255, 255, 255, 0.28);
}

.lux-select__chevron {
    flex-shrink: 0;
    width: 16px;
    height: 16px;
    transition: transform 0.2s ease;
    opacity: 0.6;
}

.lux-select.open .lux-select__chevron {
    transform: rotate(180deg);
    opacity: 1;
}

.lux-select__menu {
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    right: 0;
    background: #1a1b28;
    border: 1px solid rgba(129, 71, 242, 0.35);
    border-radius: 10px;
    padding: 0.375rem;
    z-index: 9000;
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.55), 0 0 0 1px rgba(255,255,255,0.04);
    max-height: 220px;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: rgba(129, 71, 242, 0.4) transparent;

    /* animation */
    opacity: 0;
    transform: translateY(-6px) scale(0.98);
    transform-origin: top;
    pointer-events: none;
    transition: opacity 0.15s ease, transform 0.15s ease;
}

.lux-select__menu::-webkit-scrollbar {
    width: 4px;
}
.lux-select__menu::-webkit-scrollbar-track { background: transparent; }
.lux-select__menu::-webkit-scrollbar-thumb {
    background: rgba(129, 71, 242, 0.4);
    border-radius: 2px;
}

.lux-select.open .lux-select__menu {
    opacity: 1;
    transform: translateY(0) scale(1);
    pointer-events: auto;
}

.lux-select__option {
    padding: 0.6rem 0.875rem;
    border-radius: 7px;
    cursor: pointer;
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.78);
    transition: background 0.12s, color 0.12s;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.lux-select__option:hover,
.lux-select__option.focused {
    background: rgba(129, 71, 242, 0.18);
    color: #fff;
}

.lux-select__option.selected {
    background: rgba(129, 71, 242, 0.28);
    color: #c4a8ff;
    font-weight: 600;
}

.lux-select__option.selected::after {
    content: ' ✓';
    opacity: 0.7;
}

.lux-select__option.placeholder-opt {
    color: rgba(255, 255, 255, 0.3);
    font-style: italic;
    font-size: 0.875rem;
}

/* ── Char counter ──────────────────────────────────────────────── */
.char-counter {
    text-align: right;
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.38);
    margin-top: 0.375rem;
}

.char-counter.warning { color: #FF9C2B; }
.char-counter.danger  { color: #EF4444; }

/* ── Auto-save indicator ───────────────────────────────────────── */
.auto-save-indicator {
    position: fixed;
    bottom: 5rem;
    right: 1.5rem;
    padding: 0.5rem 0.875rem;
    background: rgba(16, 185, 129, 0.1);
    border: 1px solid rgba(16, 185, 129, 0.35);
    border-radius: 8px;
    color: #10B981;
    font-size: 0.8125rem;
    font-weight: 600;
    display: none;
    align-items: center;
    gap: 0.5rem;
    z-index: 1000;
}

.auto-save-indicator.show { display: flex; }

/* ── Sticky footer / progress ──────────────────────────────────── */
.form-actions-sticky {
    position: sticky;
    bottom: 0;
    background: rgba(10, 11, 16, 0.96);
    border-top: 1px solid rgba(255, 255, 255, 0.07);
    padding: 0.875rem 0;
    margin-top: 2rem;
    backdrop-filter: blur(16px);
}

.progress-bar {
    height: 2px;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 1px;
    overflow: hidden;
    margin-bottom: 0.875rem;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary), var(--secondary));
    transition: width 0.4s ease;
    border-radius: 1px;
}

/* ── Form header ───────────────────────────────────────────────── */
.form-header-container {
    display: flex;
    align-items: center;
    gap: 1.25rem;
    text-align: left;
    padding: 1.5rem 1.75rem;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.07);
    border-radius: 14px;
    margin-bottom: 1.75rem;
}

.form-icon-wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 50px;
    height: 50px;
    border-radius: 12px;
    flex-shrink: 0;
}

.form-icon-wrapper i {
    font-size: 1.5rem;
    color: white;
}

.form-header-title {
    margin: 0;
    font-size: 1.2rem;
    font-weight: 700;
    line-height: 1.3;
}

.form-header-description {
    color: rgba(255, 255, 255, 0.45);
    margin-top: 0.3rem;
    font-size: 0.875rem;
    line-height: 1.5;
}

/* ── Section card (transparente — cada pregunta tiene su propia card) */
.section-card {
    background: transparent;
    border: none;
    padding: 0;
    box-shadow: none;
    border-radius: 0;
}

/* Ocultar heading redundante "Formulario de Postulación" */
.form-section-title {
    display: none;
}

/* ── Progress container & actions row ─────────────────────────── */
.form-progress-container {
    max-width: 860px;
    padding: 0 1rem;
}

.form-progress-fill-initial {
    width: 0%;
}

.form-actions-row {
    display: flex;
    gap: 1rem;
    align-items: center;
    justify-content: space-between;
}

.form-progress-text {
    text-align: center;
    color: rgba(255, 255, 255, 0.4);
    font-size: 0.8125rem;
}

/* Responsive */
@media (max-width: 768px) {
    .applications-public-grid {
        grid-template-columns: 1fr;
    }

    .applications-header h1 {
        font-size: 2rem;
    }

    .status-badge {
        font-size: 0.65rem;
        padding: 0.4rem 0.7rem;
    }

    .application-public-icon {
        width: 60px;
        height: 60px;
        font-size: 2rem;
    }

    /* Cerradas en mobile: ocultar badge de texto, solo stripe + nombre + botón */
    .closed-badge {
        display: none;
    }

    .closed-card__desc {
        display: none;
    }

    .closed-card__actions {
        padding: 0 0.75rem;
        gap: 0.5rem;
    }
}
