/* ========================================
   NEW TEMPLATE LAYOUT
   ======================================== */

/* Reset and Base Layout */
body {
    margin: 0;
    padding: 0;
    min-height: 100vh;
    background: var(--primary-dark);
    color: var(--text-white);
    overflow-x: hidden;
}

/* Main layout structure removed - using new section-based layout */

/* Modal Styles */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.modal {
    background: #ffffff !important;
    color: #1f2937 !important;
    border: 2px solid #e5e7eb !important;
    border-radius: 15px;
    padding: 0 !important;
    max-width: 500px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.3);
    transform: scale(0.9) translateY(-20px);
    transition: all 0.3s ease;
}

@media (min-width: 768px) {
    .modal {
        max-width: 420px;
        width: 420px;
    }
    
    /* Modal más pequeño para demos */
    .modal.demo-modal {
        max-width: 350px;
        width: 350px;
    }
    
    .modal.demo-modal .modal-header {
        padding: 20px 20px 16px;
    }
    
    .modal.demo-modal .modal-body {
        padding: 20px;
    }
    
    .modal.demo-modal .modal-title {
        font-size: 18px;
    }
}

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

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0;
    padding: 24px 24px 20px;
    border-bottom: 1px solid #e5e7eb;
    background: #f8fafc !important;
    border-radius: 15px 15px 0 0;
}

.modal-title {
    font-size: 20px;
    font-weight: 600;
    color: #1f2937 !important;
}

.modal-close {
    background: none;
    border: none;
    font-size: 20px;
    cursor: pointer;
    color: #6b7280;
    transition: all 0.3s ease;
    padding: 4px;
    border-radius: 6px;
}

.modal-close:hover {
    background: #e5e7eb;
    color: #374151;
}

.modal-body {
    padding: 24px;
    background: #ffffff !important;
    border-radius: 0 0 15px 15px;
}

/* Estilos específicos para formularios en modal */
.modal input,
.modal select,
.modal textarea {
    background: #ffffff !important;
    color: #1f2937 !important;
    border: 2px solid #d1d5db !important;
}

.modal input:focus,
.modal select:focus,
.modal textarea:focus {
    border-color: #4ade80 !important;
    background: #ffffff !important;
}



/* Welcome Modal Specifics */
.welcome-modal .modal-body {
    padding: 20px 5px;
    font-size: 16px;
    line-height: 1.6;
}

.welcome-modal .modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 15px;
    padding-top: 20px;
    border-top: 1px solid var(--border-gray);
}

.modal-button-primary, .modal-button-secondary {
    padding: 10px 20px;
    border-radius: 8px;
    border: none;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.modal-button-primary {
    background: var(--accent-green);
    color: var(--primary-dark);
}

.modal-button-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px var(--green-glow);
}

.modal-button-secondary {
    background: var(--border-gray);
    color: var(--text-gray);
}

.modal-button-secondary:hover {
    background: var(--secondary-dark);
    color: var(--text-white);
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .modal {
        width: 95%;
        padding: 20px;
        margin: 10px;
    }

    .modal-title {
        font-size: 20px;
    }
}