/* static/css/timeline-modal.css */
@import url('new-timeline.css');

/* Se mantienen los estilos base del submodal y su responsividad */

/* ===========================================
   🪟 SUBMODAL BASE
=========================================== */
.submodal {
    z-index: 1100 !important;
}

.timeline-modal-content {
    max-width: 900px !important;
    max-height: 90vh !important;
    width: 95% !important;
}

.timeline-modal-body {
    max-height: 70vh !important;
    overflow-y: auto;
    padding: 20px;
}

/* ===========================================
   📊 ESTADÍSTICAS DE TIMELINE (se pueden mantener o ajustar)
=========================================== */
.timeline-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 15px;
    margin-bottom: 25px;
}

.timeline-stat {
    background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
    padding: 20px;
    border-radius: var(--border-radius);
    text-align: center;
    border: 1px solid #e2e8f0;
    transition: var(--transition);
}

.timeline-stat:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.timeline-stat-number {
    font-size: 2rem;
    font-weight: 700;
    color: var(--timeline-primary);
    margin-bottom: 5px;
}

.timeline-stat-label {
    font-size: 12px;
    color: var(--secondary-color);
    text-transform: uppercase;
    font-weight: 600;
}

/* ===========================================
   🎛️ CONTROLES DE TIMELINE HEADER
=========================================== */
.timeline-header-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid #e2e8f0;
}

/* ===========================================
   📝 FORMULARIO DE TIMELINE
=========================================== */
.timeline-form {
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    padding: 25px;
    border-radius: var(--border-radius);
    margin-top: 25px;
    border: 2px dashed var(--timeline-primary);
    animation: timeline-form-appear 0.3s ease-out;
}

@keyframes timeline-form-appear {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ===========================================
   🎨 VARIABLES DE TIMELINE
=========================================== */
:root {
    --timeline-primary: #4f46e5;
    --timeline-success: #10b981;
    --timeline-warning: #f59e0b;
    --timeline-danger: #ef4444;
    --timeline-info: #0ea5e9;
}

/* ===========================================
   🔘 BOTONES DEL MODAL TIMELINE
=========================================== */
.timeline-header-controls h4 {
    margin: 0;
    font-size: 1.1rem;
    color: #1e293b;
    display: flex;
    align-items: center;
    gap: 8px;
}

.timeline-header-controls h4 i {
    color: var(--timeline-primary);
}

.timeline-add-btn {
    background: linear-gradient(135deg, var(--timeline-success) 0%, #059669 100%);
    color: white;
    border: none;
    padding: 10px 18px;
    border-radius: 8px;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    box-shadow: 0 2px 8px rgba(16, 185, 129, 0.3);
}

.timeline-add-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.4);
}

.timeline-add-btn:active {
    transform: translateY(0);
}

/* Botón de documentos */
.timeline-header-controls .btn-primary {
    background: linear-gradient(135deg, var(--timeline-primary) 0%, #4338ca 100%);
    color: white;
    border: none;
    padding: 10px 18px;
    border-radius: 8px;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    box-shadow: 0 2px 8px rgba(79, 70, 229, 0.3);
}

.timeline-header-controls .btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(79, 70, 229, 0.4);
}

/* ===========================================
   📝 FORMULARIO DE TIMELINE - ELEMENTOS
=========================================== */
.timeline-form h5 {
    color: #1e293b;
    font-size: 1rem;
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 20px;
}

.timeline-form h5 i {
    color: var(--timeline-primary);
}

.timeline-form .form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
    margin-bottom: 15px;
}

.timeline-form .form-group {
    margin-bottom: 15px;
}

.timeline-form .form-group label {
    display: block;
    font-weight: 600;
    color: #475569;
    margin-bottom: 6px;
    font-size: 13px;
}

.timeline-form .timeline-input,
.timeline-form .form-control {
    width: 100%;
    padding: 12px 14px;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    font-size: 14px;
    transition: all 0.2s ease;
    background: white;
}

.timeline-form .timeline-input:focus,
.timeline-form .form-control:focus {
    outline: none;
    border-color: var(--timeline-primary);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

.timeline-form textarea.timeline-input,
.timeline-form textarea.form-control {
    resize: vertical;
    min-height: 80px;
}

/* ===========================================
   🔘 BOTONES DEL FORMULARIO
=========================================== */
.timeline-form-buttons {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #e2e8f0;
}

.timeline-form-buttons .btn {
    padding: 12px 24px;
    border-radius: 8px;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    border: none;
}

.timeline-form-buttons .btn-secondary {
    background: #f1f5f9;
    color: #64748b;
    border: 2px solid #e2e8f0;
}

.timeline-form-buttons .btn-secondary:hover {
    background: #e2e8f0;
    color: #475569;
}

.timeline-form-buttons .btn-success {
    background: linear-gradient(135deg, var(--timeline-success) 0%, #059669 100%);
    color: white;
    box-shadow: 0 2px 8px rgba(16, 185, 129, 0.3);
}

.timeline-form-buttons .btn-success:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.4);
}

.timeline-form-buttons .btn-success:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
}

/* ===========================================
   📱 RESPONSIVE
=========================================== */
@media (max-width: 768px) {
    .timeline-header-controls {
        flex-direction: column;
        gap: 15px;
        align-items: stretch;
    }

    .timeline-header-controls > div {
        display: flex;
        flex-direction: column;
        gap: 10px;
    }

    .timeline-add-btn,
    .timeline-header-controls .btn-primary {
        width: 100%;
        justify-content: center;
    }

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

    .timeline-form-buttons {
        flex-direction: column;
    }

    .timeline-form-buttons .btn {
        width: 100%;
        justify-content: center;
    }

    .timeline-stats {
        grid-template-columns: 1fr;
    }
}

/* ===========================================
   🎯 HEADER DEL MODAL
=========================================== */
.timeline-header {
    background: linear-gradient(135deg, var(--timeline-primary) 0%, #4338ca 100%);
    color: white;
    padding: 20px 25px;
    border-radius: var(--border-radius, 12px) var(--border-radius, 12px) 0 0;
}

.timeline-header h3 {
    margin: 0;
    font-size: 1.25rem;
    display: flex;
    align-items: center;
    gap: 10px;
}

.timeline-header .close-modal {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    font-size: 1.5rem;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.timeline-header .close-modal:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: rotate(90deg);
}

/* ===========================================
   📋 LISTA DE TIMELINE
=========================================== */
.timeline-list {
    min-height: 200px;
    max-height: 400px;
    overflow-y: auto;
    padding: 5px;
}