/* style.css */

body {
    background-color: #f0f2f5; /* Light gray background */
    font-family: 'Inter', sans-serif;
    color: #333;
}

.main-container {
    display: flex;
    height: 100vh;
    width: 100vw;
    overflow: hidden;
}

.form-section {
    width: 45%;
    height: 100vh;
    overflow-y: auto;
    padding: 35px 40px;
    background-color: #ffffff;
    border-right: 1px solid #e0e0e0;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05); /* Subtle shadow */
}

.preview-section {
    width: 55%;
    height: 100vh;
    overflow-y: auto;
    padding: 35px 40px;
    background-color: #f8f9fa;
}

#preview-pane {
    background-color: #ffffff;
    padding: 50px 60px;
    border: 1px solid #e0e0e0;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1); /* More pronounced shadow */
    min-height: 95%;
    font-size: 14px;
    color: #333;
    transition: all 0.3s ease;
    border-radius: 8px; /* Rounded corners */
}

#preview-logo {
    max-width: 160px;
    max-height: 70px;
    object-fit: contain;
}

.service-item {
    border: 1px solid #e9ecef;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 15px;
    position: relative;
    background-color: #fdfdfd;
}

.service-item-template {
    display: none;
}

.remove-service-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    background: none;
    border: none;
    font-size: 1.2rem;
    color: #dc3545;
    opacity: 0.7;
}
.remove-service-btn:hover {
    opacity: 1;
}

.form-section h2 {
    font-weight: 600;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 1px solid #eee;
    color: #2c3e50;
}

#preview-pane h1, #preview-pane h2, #preview-pane h3 {
    font-weight: 600;
    color: #2c3e50;
}

.preview-header {
    border-bottom: 2px solid #0d6efd;
    padding-bottom: 20px;
}

.preview-footer {
    margin-top: 40px;
    padding-top: 20px;
    border-top: 1px solid #eee;
    font-size: 12px;
    color: #666;
}

.total-section {
    text-align: right;
    margin-top: 30px;
}

.total-section h3 {
    font-size: 1.5rem;
}

.form-actions {
    position: sticky;
    bottom: 0;
    background: #fff;
    padding: 20px 0;
    border-top: 1px solid #eee;
    z-index: 1000; /* Ensure it's above other content */
}

.theme-switcher {
    position: sticky;
    bottom: 0;
    background-color: #f4f7f9;
    padding: 10px 0;
    text-align: center;
    z-index: 1000; /* Ensure it's above other content */
}

.service-details {
    font-size: 0.85em;
    color: #666;
    padding: 5px 10px;
    background-color: #f8f9fa;
    border-top: 1px solid #eee;
}

/* Form specific styles */
.form-control, .form-select, .btn {
    border-radius: 5px; /* Slightly rounded corners for inputs and buttons */
}

.form-control:focus, .form-select:focus {
    border-color: #80bdff; /* Bootstrap default focus color */
    box-shadow: 0 0 0 0.25rem rgba(13, 110, 253, 0.25); /* Subtle blue shadow on focus */
}

.btn-primary {
    box-shadow: 0 4px 10px rgba(13, 110, 253, 0.2); /* Shadow for primary button */
}

.btn-primary:hover {
    box-shadow: 0 6px 15px rgba(13, 110, 253, 0.3); /* More pronounced shadow on hover */
}

/* --- THEME STYLES --- */

/* Theme 1: Profesional (Default) */
.theme-professional .preview-header { border-color: #0d6efd; }
.theme-professional thead { background-color: #0d6efd !important; color: white; }

/* Theme 2: Creativo */
.theme-creative {
    font-family: 'Georgia', serif;
}
.theme-creative .preview-header { border-color: #fd7e14; }
.theme-creative thead { background-color: #fd7e14 !important; color: white; }
.theme-creative h1, .theme-creative h5 { font-weight: bold; }

/* Theme 3: Minimalista */
.theme-minimalist {
    font-family: 'Courier New', monospace;
    border-width: 1px;
    box-shadow: none;
}
.theme-minimalist .preview-header { border-bottom: 1px solid #333; }
.theme-minimalist table { border: 1px solid #eee; }
.theme-minimalist thead { background-color: #f8f9fa !important; color: #333; border-bottom: 1px solid #ccc; }
.theme-minimalist .table-striped>tbody>tr:nth-of-type(odd)>* { background-color: transparent; }

/* Theme 4: Moderno (Dark) */
.theme-modern {
    background-color: #212529;
    color: #f8f9fa;
    border-color: #495057;
}
.theme-modern .preview-header { border-color: #08f; }
.theme-modern h5 { color: #adb5bd; }
.theme-modern strong { color: #fff; }
.theme-modern .table { color: #f8f9fa; }
.theme-modern thead { background-color: #08f !important; color: white; }
.theme-modern .table-striped>tbody>tr:nth-of-type(odd)>* { background-color: rgba(255, 255, 255, 0.05); }
.theme-modern .preview-footer { border-top-color: #495057; color: #adb5bd; }

/* --- RESPONSIVE DESIGN --- */
@media (max-width: 992px) { /* Se aplica a tablets y móviles */
    .main-container {
        flex-direction: column; /* Apila las columnas verticalmente */
        height: auto;
        overflow: auto;
    }

    .form-section,
    .preview-section {
        width: 100%;
        height: auto;
        overflow-y: visible;
        border-right: none;
        padding: 20px;
    }

    .preview-section {
        padding-top: 30px;
    }

    #preview-pane {
        min-height: auto;
        padding: 25px 20px;
    }
    
    .form-actions {
        position: relative; /* El botón deja de estar pegado abajo */
        padding: 10px 0;
    }

    .total-section .col-4 {
        width: 60%; /* Más ancho para el total en móviles */
    }
}
