/* ===================================================
   Gastos Modal - Agregar/Editar Gasto Fijo
   CSS extraido de gastos-modal-agregargastofijo.js
   =================================================== */

/* Custom dropdown styles */
.custom-dropdown {
    position: relative;
    width: 100%;
}

.custom-dropdown-selected {
    background: #222;
    color: #fff;
    border: 1.5px solid var(--border-color);
    border-radius: 0.25rem;
    padding: 0.4rem 2rem 0.4rem 0.5rem;
    font-size: 0.85rem;
    cursor: pointer;
    transition: border-color 0.2s;
}

.custom-dropdown-selected:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.08);
}

.custom-dropdown-list {
    position: absolute;
    top: 110%;
    left: 0;
    width: 100%;
    background: #222;
    color: #fff;
    border: 1.5px solid var(--border-color);
    border-radius: 0.25rem;
    box-shadow: 0 4px 16px rgba(0,0,0,0.25);
    z-index: 10;
    max-height: 220px;
    overflow-y: auto;
    display: none;
}

.custom-dropdown.open .custom-dropdown-list {
    display: block;
}

.custom-dropdown-option {
    padding: 0.5rem 0.7rem;
    cursor: pointer;
    font-size: 0.85rem;
    border-bottom: 1px solid var(--border-color);
}

.custom-dropdown-option:last-child {
    border-bottom: none;
}

.custom-dropdown-option:hover {
    background: #333;
}

.custom-dropdown-option.selected {
    background: #444;
    color: #ffd700;
}

/* Layout de 3 columnas para agregar gastos */
.gasto-form-layout {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 1.2rem;
    margin-bottom: 1.2rem;
}

.gasto-form-column {
    display: flex;
    flex-direction: column;
    gap: 0.7rem;
}

.gasto-form-column h4 {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.3rem;
    text-align: center;
}

/* Columna izquierda: Informacion basica */
.gasto-form-basico {
    border-right: 1.5px solid var(--border-color);
    padding-right: 0.7rem;
}

/* Columna central: Detalles */
.gasto-form-detalles {
    padding: 0 0.7rem;
}

/* Columna derecha: Estado y notas */
.gasto-form-estado {
    border-left: 1.5px solid var(--border-color);
    padding-left: 0.7rem;
}

.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
}

.modal.show {
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-content {
    background-color: var(--card-background);
    border-radius: 0.5rem;
    box-shadow: var(--shadow-lg);
    width: 95%;
    max-width: 1200px;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    padding: 1.5rem;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 0 1rem 0;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 1rem;
}

.modal-header h3 {
    margin: 0;
    color: var(--text-primary);
}

.close {
    color: var(--text-secondary);
    font-size: 1.5rem;
    font-weight: bold;
    cursor: pointer;
}

.close:hover {
    color: var(--text-primary);
}

.form-group {
    margin-bottom: 0.7rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.22rem;
    font-weight: 500;
    color: var(--text-primary);
    font-size: 0.85rem;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 0.35rem 0.45rem;
    border: 1px solid var(--border-color);
    border-radius: 0.25rem;
    background: var(--input-background);
    color: var(--text-primary);
    font-size: 0.85rem;
    height: 2rem;
}

.form-group textarea {
    resize: vertical;
    min-height: 50px;
    height: auto;
}

.form-actions {
    display: flex;
    gap: 0.5rem;
    justify-content: flex-end;
    margin-top: 1rem;
    padding-top: 0.7rem;
    border-top: 1px solid var(--border-color);
}

.btn-primary, .btn-secondary {
    padding: 0.5rem 1rem;
    border: none;
    border-radius: 0.25rem;
    cursor: pointer;
    font-weight: 500;
    transition: background-color 0.3s;
}

.btn-primary {
    background: var(--primary-color);
    color: white;
}

.btn-primary:hover {
    background: #1d4ed8;
}

.btn-secondary {
    background: var(--secondary-color);
    color: white;
}

.btn-secondary:hover {
    background: #475569;
}

.estado-seleccion-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.estado-seleccion-card {
    padding: 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: 0.375rem;
    background: linear-gradient(135deg, var(--background-color) 0%, rgba(32, 32, 32, 0.8) 100%);
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
    overflow: hidden;
    text-align: center;
}

.estado-seleccion-card:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(212, 175, 55, 0.15);
    border-color: var(--primary-color);
}

.estado-seleccion-card.selected {
    border-color: var(--primary-color);
    background: linear-gradient(135deg, rgba(212, 175, 55, 0.05), rgba(184, 134, 11, 0.03));
    box-shadow: 0 0 0 2px rgba(212, 175, 55, 0.2);
}

.estado-seleccion-card.selected::before {
    content: '\2713';
    position: absolute;
    top: 0.25rem;
    right: 0.25rem;
    background: var(--primary-color);
    color: white;
    width: 1rem;
    height: 1rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 0.6rem;
}

.estado-icon {
    font-size: 1.25rem;
    margin-bottom: 0.25rem;
}

.estado-title {
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.125rem;
    font-size: 0.8rem;
}

.estado-desc {
    font-size: 0.7rem;
    color: var(--text-secondary);
    line-height: 1.2;
}

/* Estilos para el nuevo sistema de botones de estado */
.estado-toggle-group {
    display: flex;
    gap: 0.5rem;
    justify-content: center;
    margin-top: 0.5rem;
}

.estado-toggle-btn {
    flex: 1;
    padding: 0.5rem 0.5rem;
    border: 2px solid var(--border-color);
    border-radius: 0.5rem;
    background: var(--input-background);
    color: var(--text-primary);
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    transition: background 0.2s, color 0.2s, border-color 0.2s, box-shadow 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    opacity: 0.7;
    box-shadow: none;
}

.estado-toggle-btn.selected {
    opacity: 1;
    box-shadow: 0 2px 12px 0 rgba(37,99,235,0.12);
}

.estado-toggle-btn.activo.selected {
    background: linear-gradient(90deg, #2563eb 0%, #60a5fa 100%);
    color: #fff;
    border-color: #2563eb;
}

.estado-toggle-btn.pausado.selected {
    background: linear-gradient(90deg, #475569 0%, #64748b 100%);
    color: #fff;
    border-color: #475569;
}

.estado-toggle-btn:not(.selected) {
    background: var(--input-background);
    color: var(--text-secondary);
    border-color: var(--border-color);
    opacity: 0.6;
}
