/* ========================================
   CALCULADORA DE COSTOS DE IMPRESIÓN 3D
   Estilos personalizados con Bootstrap 5
   ======================================== */

/* Variables CSS personalizadas */
:root {
    --primary-color: #3498db;
    --secondary-color: #7f8c8d;
    --success-color: #27ae60;
    --danger-color: #e74c3c;
    --warning-color: #f39c12;
    --info-color: #3498db;
    --light-color: #f8f9fa;
    --dark-color: #2c3e50;
    --text-dark: #34495e;
    --text-muted: #7f8c8d;
    --border-color: #ddd;
    --border-light: #eaeaea;
    --background-light: #ecf0f1;
    --gradient-bg: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    --shadow-lg: 0 1rem 3rem rgba(0, 0, 0, 0.175);
    --border-radius: 0.5rem;
    --transition: all 0.3s ease;
}

/* Reset y configuración base */
* {
    box-sizing: border-box;
}

html {
    overflow-x: hidden;
}

body {
    background: var(--gradient-bg);
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: var(--dark-color);
}

/* Contenedor principal */
.container-fluid {
    min-height: 100vh;
    padding: 1rem;
}

/* Card principal */
.card {
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-lg);
    overflow: hidden;
}

.card-header {
    border-bottom: none;
    background: var(--dark-color) !important;
}

.card-header h1 {
    font-weight: 600;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.card-header p {
    color: var(--background-light);
    font-size: 0.95rem;
}

/* Sección de parámetros */
.bg-light {
    background-color: var(--light-color) !important;
    border-right: 1px solid #dee2e6;
}

.bg-light .h5 {
    color: #000000 !important;
}

/* Títulos de sección */
.h5 {
    font-weight: 600;
    color: #000000 !important;
    border-bottom: 2px solid var(--primary-color);
    padding-bottom: 0.5rem;
    margin-bottom: 1.5rem;
}

/* Formularios */
.form-label {
    font-weight: 500;
    color: var(--text-dark);
    margin-bottom: 0.5rem;
}

.form-control {
    border: 2px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: 0.75rem 1rem;
    font-size: 1rem;
    background: white;
    transition: var(--transition);
    box-shadow: none;
}

.form-control:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.2rem rgba(52, 152, 219, 0.25);
    transform: translateY(-1px);
}

.form-control:hover {
    border-color: var(--primary-color);
}

/* Botones */
.btn {
    border-radius: var(--border-radius);
    font-weight: 500;
    transition: var(--transition);
    border: none;
    padding: 0.75rem 1.5rem;
}

.btn-primary {
    background: var(--primary-color);
    box-shadow: 0 4px 6px rgba(52, 152, 219, 0.2);
}

.btn-primary:hover {
    background: #2980b9;
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(52, 152, 219, 0.3);
}

.btn-primary:active {
    transform: translateY(-1px);
    box-shadow: 0 4px 15px rgba(52, 152, 219, 0.3);
}

/* Botón de guardar datos específico */
.btn-save {
    background: linear-gradient(135deg, var(--primary-color) 0%, #2980b9 100%);
    box-shadow: 0 6px 20px rgba(52, 152, 219, 0.3);
    border: none;
    border-radius: 8px;
    padding: 1rem 2rem;
    font-size: 1.1rem;
    font-weight: 600;
    color: white !important;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.btn-save::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    transition: left 0.6s ease;
}

.btn-save:hover::before {
    left: 100%;
}

.btn-save:hover {
    background: linear-gradient(135deg, #2980b9 0%, #1f4e79 100%);
    transform: translateY(-4px) scale(1.02);
    box-shadow: 0 12px 30px rgba(52, 152, 219, 0.4);
    color: white !important;
}

.btn-save:hover i {
    color: white !important;
}

.btn-save:active {
    transform: translateY(-2px) scale(0.98);
    box-shadow: 0 6px 20px rgba(52, 152, 219, 0.3);
}

.btn-save:focus {
    outline: none;
    box-shadow: 0 0 0 4px rgba(52, 152, 219, 0.2);
}

.btn-save i {
    margin-right: 8px;
    font-size: 1.1em;
    color: white !important;
}

/* Botón de restablecer valores específico */
.btn-reset {
    background: #f8f9fa !important;
    border: 2px solid #dee2e6 !important;
    border-radius: 6px !important;
    padding: 0.75rem 1.5rem !important;
    font-size: 1rem !important;
    font-weight: 500 !important;
    color: #6c757d !important;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1) !important;
    transition: all 0.3s ease !important;
    text-transform: none !important;
    letter-spacing: 0.3px !important;
    display: inline-block !important;
    text-align: center !important;
    vertical-align: middle !important;
    cursor: pointer !important;
}

.btn-reset:hover {
    background: #e9ecef;
    border-color: #adb5bd;
    color: #495057 !important;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.btn-reset:hover i {
    color: #495057 !important;
}

.btn-reset:active {
    transform: translateY(0);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.btn-reset:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(108, 117, 125, 0.2);
}

.btn-reset i {
    margin-right: 6px;
    font-size: 1em;
    color: #6c757d !important;
}

/* Tabla de resultados */
.table {
    margin-bottom: 0;
    border-radius: var(--border-radius);
    overflow: hidden;
}

.table thead th {
    background: var(--primary-color);
    color: white;
    border: none;
    font-weight: 600;
    padding: 1rem 0.75rem;
    text-align: left;
}

.table tbody td {
    padding: 0.875rem 0.75rem;
    vertical-align: middle;
    border-color: var(--border-light);
    color: var(--text-dark);
}

.table-hover tbody tr:hover {
    background-color: rgba(52, 152, 219, 0.05);
}

.table-warning {
    background-color: rgba(255, 193, 7, 0.1) !important;
}

.table-warning td {
    background-color: transparent !important;
}

/* Colores de texto para precios */
.text-danger {
    color: var(--danger-color) !important;
    font-weight: 600;
}

.text-success {
    color: var(--success-color) !important;
    font-weight: 600;
}

.text-muted {
    color: var(--text-muted) !important;
}

.fw-bold {
    font-weight: 700 !important;
}

/* Iconos */
.fas, .far {
    color: var(--primary-color);
}

.text-muted .fas {
    color: var(--text-muted);
}

/* Alertas */
.alert {
    border: none;
    border-radius: var(--border-radius);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.alert-info {
    background: linear-gradient(135deg, rgba(13, 202, 240, 0.1) 0%, rgba(13, 202, 240, 0.05) 100%);
    border-left: 4px solid var(--info-color);
}

.alert-heading {
    color: var(--dark-color);
    font-weight: 600;
}

/* Status de guardado */
.save-status {
    min-height: 1.5rem;
    font-size: 0.9rem;
}

/* Footer */
.card-footer {
    background: var(--light-color) !important;
    border-top: 1px solid var(--border-light);
}

.card-footer .text-muted {
    color: var(--text-muted) !important;
}

/* Responsive Design */
@media (max-width: 991.98px) {
    .bg-light {
        border-right: none;
        border-bottom: 1px solid #dee2e6;
    }
    
    .container-fluid {
        padding: 0.5rem;
    }
    
    .card {
        margin: 0;
        border-radius: 0;
    }
    
    .card-header {
        padding: 1.5rem 1rem;
    }
    
    .card-header h1 {
        font-size: 1.5rem;
    }
    
    .card-header p {
        font-size: 0.85rem;
    }
}

@media (max-width: 767.98px) {
    .container-fluid {
        padding: 0;
    }
    
    .card {
        border-radius: 0;
        box-shadow: none;
    }
    
    .card-header {
        padding: 1rem;
    }
    
    .card-header h1 {
        font-size: 1.25rem;
    }
    
    .card-body .p-4 {
        padding: 1rem !important;
    }
    
    .h5 {
        font-size: 1.1rem;
        margin-bottom: 1rem;
    }
    
    .form-control {
        padding: 0.625rem 0.875rem;
        font-size: 1rem;
    }
    
    .btn-save {
        padding: 0.875rem 1.5rem;
        font-size: 1rem;
        letter-spacing: 0.3px;
    }
    
    .btn-reset {
        padding: 0.75rem 1.25rem;
        font-size: 0.95rem;
        letter-spacing: 0.2px;
    }
    
    .table {
        font-size: 0.875rem;
    }
    
    .table thead th,
    .table tbody td {
        padding: 0.5rem 0.375rem;
    }
    
    .small {
        font-size: 0.75rem;
    }
}

@media (max-width: 575.98px) {
    .card-header h1 {
        font-size: 1.1rem;
    }
    
    .card-header p {
        font-size: 0.8rem;
    }
    
    .h5 {
        font-size: 1rem;
    }
    
    .form-control {
        padding: 0.5rem 0.75rem;
        font-size: 0.95rem;
    }
    
    .btn-save {
        padding: 0.75rem 1.25rem;
        font-size: 0.95rem;
        letter-spacing: 0.2px;
    }
    
    .btn-reset {
        padding: 0.625rem 1rem;
        font-size: 0.9rem;
        letter-spacing: 0.1px;
    }
    
    .table {
        font-size: 0.8rem;
    }
    
    .table thead th,
    .table tbody td {
        padding: 0.375rem 0.25rem;
    }
    
    .small {
        font-size: 0.7rem;
    }
    
    .alert {
        padding: 0.75rem;
    }
    
    .alert-heading {
        font-size: 0.95rem;
    }
}

/* Animaciones */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.card {
    animation: fadeIn 0.6s ease-out;
}

/* Efectos hover mejorados */
.form-control:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.btn:hover {
    transform: translateY(-2px);
}

/* Scroll suave */
html {
    scroll-behavior: smooth;
}

/* Focus visible para accesibilidad */
.form-control:focus-visible,
.btn:focus-visible {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

/* Mejoras de accesibilidad */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Print styles */
@media print {
    .container-fluid {
        background: white !important;
    }
    
    .card {
        box-shadow: none !important;
        border: 1px solid #000 !important;
    }
    
    .btn {
        display: none !important;
    }
}

/* ========================================
   MODAL PERSONALIZADO
   ======================================== */

#resetConfirmModal .modal-content {
    border: none;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    overflow: hidden;
}

#resetConfirmModal .modal-header {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-bottom: 1px solid #dee2e6;
}

#resetConfirmModal .modal-title {
    color: #495057;
    font-weight: 600;
    font-size: 1.1rem;
}

#resetConfirmModal .modal-body {
    background: #ffffff;
    padding: 2rem 1.5rem;
}

#resetConfirmModal .modal-body h6 {
    color: #495057;
    font-weight: 600;
    margin-bottom: 1rem;
}

#resetConfirmModal .modal-body p {
    color: #6c757d;
    font-size: 0.95rem;
    line-height: 1.5;
}

#resetConfirmModal .modal-footer {
    background: #f8f9fa;
    padding: 1rem 1.5rem;
}

#resetConfirmModal .btn-outline-secondary {
    border-color: #6c757d;
    color: #6c757d;
    font-weight: 500;
    padding: 0.5rem 1.2rem;
    border-radius: 8px;
    transition: all 0.3s ease;
}

#resetConfirmModal .btn-outline-secondary:hover {
    background-color: #6c757d;
    border-color: #6c757d;
    color: white;
    transform: translateY(-1px);
}

#resetConfirmModal .btn-warning {
    background: linear-gradient(135deg, #ffc107 0%, #ff8c00 100%);
    border: none;
    color: white;
    font-weight: 600;
    padding: 0.5rem 1.2rem;
    border-radius: 8px;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(255, 193, 7, 0.3);
}

#resetConfirmModal .btn-warning:hover {
    background: linear-gradient(135deg, #ff8c00 0%, #ff6b00 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(255, 193, 7, 0.4);
}

#resetConfirmModal .btn-warning:active {
    transform: translateY(0);
    box-shadow: 0 2px 10px rgba(255, 193, 7, 0.3);
}

#resetConfirmModal .fa-undo {
    animation: rotateIn 0.6s ease-out;
}

@keyframes rotateIn {
    from {
        opacity: 0;
        transform: rotate(-180deg) scale(0.5);
    }
    to {
        opacity: 1;
        transform: rotate(0deg) scale(1);
    }
}