/* Custom styles for Pantallas digiApp */

:root {
    --primary-color: #0d6efd;
    --success-color: #198754;
    --danger-color: #dc3545;
    --warning-color: #ffc107;
    --info-color: #0dcaf0;
    --light-color: #f8f9fa;
    --dark-color: #212529;
}

body {
    background-color: var(--light-color);
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

.navbar-brand {
    font-weight: bold;
    font-size: 1.5rem;
}

.card {
    border: none;
    border-radius: 10px;
    box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
    transition: box-shadow 0.15s ease-in-out;
}

.card:hover {
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
}

.card-header {
    border-radius: 10px 10px 0 0 !important;
    border-bottom: none;
}

.btn {
    border-radius: 8px;
    font-weight: 500;
    transition: all 0.2s ease-in-out;
}

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

.form-control, .form-select {
    border-radius: 8px;
    border: 1px solid #dee2e6;
    transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
}

.form-control:focus, .form-select:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.2rem rgba(13, 110, 253, 0.25);
}

/* Center Cards */
.center-card {
    transition: transform 0.2s ease-in-out;
    height: 100%;
}

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

/* Card headers use Bootstrap classes: bg-success, bg-danger, bg-warning */

/* Force grid layout */
#centers-grid {
    display: flex !important;
    flex-wrap: wrap !important;
}

#centers-grid > div[class*="col-"] {
    flex: 0 0 auto;
}

@media (min-width: 768px) {
    #centers-grid > .col-md-6 {
        flex: 0 0 50%;
        max-width: 50%;
    }
}

@media (min-width: 992px) {
    #centers-grid > .col-lg-4 {
        flex: 0 0 33.333333%;
        max-width: 33.333333%;
    }
}

/* Progress bars */
.progress {
    height: 8px;
    border-radius: 10px;
}

.progress-bar {
    border-radius: 10px;
}

/* Status badges */
.status-badge {
    font-size: 0.75rem;
    padding: 0.375rem 0.75rem;
    border-radius: 20px;
    font-weight: 600;
}

.status-complete {
    background-color: var(--success-color);
    color: white;
}

.status-pending {
    background-color: var(--danger-color);
    color: white;
}

.status-partial {
    background-color: var(--warning-color);
    color: var(--dark-color);
}

/* Form sections */
.form-section {
    background-color: white;
    border-radius: 10px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    border: 1px solid #e9ecef;
}

.section-title {
    color: var(--primary-color);
    font-weight: 600;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--primary-color);
}

/* File upload styling */
.file-upload-area {
    border: 2px dashed #dee2e6;
    border-radius: 10px;
    padding: 2rem;
    text-align: center;
    background-color: #f8f9fa;
    transition: all 0.3s ease;
}

.file-upload-area:hover {
    border-color: var(--primary-color);
    background-color: rgba(13, 110, 253, 0.05);
}

.file-upload-area.dragover {
    border-color: var(--primary-color);
    background-color: rgba(13, 110, 253, 0.1);
}

/* Loading spinner */
.loading-spinner {
    display: inline-block;
    width: 1rem;
    height: 1rem;
    border: 2px solid #f3f3f3;
    border-top: 2px solid var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Alert styling */
.alert {
    border-radius: 10px;
    border: none;
}

.alert-success {
    background-color: rgba(25, 135, 84, 0.1);
    color: var(--success-color);
    border-left: 4px solid var(--success-color);
}

.alert-danger {
    background-color: rgba(220, 53, 69, 0.1);
    color: var(--danger-color);
    border-left: 4px solid var(--danger-color);
}

.alert-warning {
    background-color: rgba(255, 193, 7, 0.1);
    color: #856404;
    border-left: 4px solid var(--warning-color);
}

.alert-info {
    background-color: rgba(13, 202, 240, 0.1);
    color: #055160;
    border-left: 4px solid var(--info-color);
}

/* Table styling */
.table {
    border-radius: 10px;
    overflow: hidden;
}

.table thead th {
    background-color: var(--primary-color);
    color: white;
    border: none;
    font-weight: 600;
}

.table tbody tr:hover {
    background-color: rgba(13, 110, 253, 0.05);
}

/* Modal styling */
.modal-content {
    border-radius: 15px;
    border: none;
}

.modal-header {
    border-bottom: 1px solid #e9ecef;
    border-radius: 15px 15px 0 0;
}

.modal-footer {
    border-top: 1px solid #e9ecef;
    border-radius: 0 0 15px 15px;
}

/* Mobile-first responsive design */

/* Touch-friendly interactions */
@media (hover: none) and (pointer: coarse) {
    .btn {
        min-height: 44px;
        min-width: 44px;
    }
    
    .form-control, .form-select {
        min-height: 44px;
        font-size: 16px; /* Prevents zoom on iOS */
    }
    
    .card {
        margin-bottom: 1rem;
    }
}

/* Optimizaciones móviles con Bootstrap */
@media (max-width: 575.98px) {
    /* Formularios móviles optimizados */
    .form-control, .form-select {
        font-size: 16px !important; /* Evita zoom en iOS */
        padding: 0.75rem !important;
        background-color: #ffffff !important;
        color: #212529 !important;
        border: 2px solid #dee2e6 !important;
        border-radius: 8px !important;
    }
    
    .form-control:focus, .form-select:focus {
        border-color: var(--primary-color) !important;
        box-shadow: 0 0 0 0.2rem rgba(13, 110, 253, 0.25) !important;
        background-color: #ffffff !important;
    }
    
    /* Botones móviles */
    .btn {
        min-height: 48px !important; /* Tamaño táctil mínimo */
        font-size: 16px !important;
        font-weight: 500 !important;
        border-radius: 8px !important;
    }
    
    /* Cards móviles */
    .card {
        border-radius: 12px !important;
        margin-bottom: 1rem !important;
        background-color: #ffffff !important;
        border: 1px solid #e9ecef !important;
    }
    
    .card-body {
        padding: 1rem !important;
    }
    
    /* Navbar móvil */
    .navbar-brand {
        font-size: 1.1rem !important;
    }
    
    /* Modales móviles */
    .modal-dialog {
        margin: 0.5rem !important;
        max-width: calc(100% - 1rem) !important;
    }
    
    /* Dropdown del buscador móvil */
    #centro-dropdown {
        background-color: #ffffff !important;
        border: 2px solid #dee2e6 !important;
        border-radius: 8px !important;
        box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1) !important;
    }
    
    #centro-dropdown div {
        padding: 0.75rem !important;
        color: #212529 !important;
        background-color: #ffffff !important;
    }
    
    #centro-dropdown div:hover {
        background-color: #f8f9fa !important;
    }
}

/* Small tablets (576px to 767.98px) */
@media (min-width: 576px) and (max-width: 767.98px) {
    .container-fluid {
        padding: 0.5rem;
    }
    
    .card-body {
        padding: 1.25rem;
    }
    
    .btn {
        min-height: 40px;
    }
    
    .form-control, .form-select {
        min-height: 40px;
    }
}

/* Medium tablets (768px to 991.98px) */
@media (min-width: 768px) and (max-width: 991.98px) {
    .container-fluid {
        padding: 0.75rem;
    }
    
    .center-card {
        margin-bottom: 1.5rem;
    }
}

/* Large tablets and small desktops (992px to 1199.98px) */
@media (min-width: 992px) and (max-width: 1199.98px) {
    .container-fluid {
        padding: 1rem;
    }
}

/* Extra large screens (1200px and up) */
@media (min-width: 1200px) {
    .container-fluid {
        max-width: 100%;
        padding-left: 2rem;
        padding-right: 2rem;
    }
}

/* Landscape phone orientation */
@media (max-width: 767.98px) and (orientation: landscape) {
    .navbar {
        padding: 0.25rem 1rem;
    }
    
    .navbar-brand {
        font-size: 1.1rem;
    }
    
    .container-fluid {
        padding: 0.5rem;
    }
    
    .card-body {
        padding: 0.75rem;
    }
}

/* High DPI displays */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    .card {
        box-shadow: 0 0.125rem 0.5rem rgba(0, 0, 0, 0.1);
    }
}

/* Forzar modo claro siempre */
:root {
    --bs-body-bg: #ffffff !important;
    --bs-body-color: #212529 !important;
}

body {
    background-color: #f8f9fa !important;
    color: #212529 !important;
}

.card {
    background-color: #ffffff !important;
    border: 1px solid #dee2e6 !important;
    color: #212529 !important;
}

.form-control, .form-select {
    background-color: #ffffff !important;
    border-color: #dee2e6 !important;
    color: #212529 !important;
}

.table {
    --bs-table-bg: #ffffff !important;
    --bs-table-color: #212529 !important;
    background-color: #ffffff !important;
    color: #212529 !important;
}

/* Asegurar que todos los inputs sean blancos */
input, select, textarea {
    background-color: #ffffff !important;
    color: #212529 !important;
    border-color: #dee2e6 !important;
}

/* Dropdown del buscador de centros */
#centro-dropdown {
    background-color: #ffffff !important;
    color: #212529 !important;
}

/* 🔥 TOAST NOTIFICATIONS SÚPER CHULOS */
.toast-container {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 9999;
    pointer-events: none;
}

.toast-notification {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 1rem 1.5rem;
    border-radius: 12px;
    margin-bottom: 0.5rem;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    display: flex;
    align-items: center;
    gap: 0.75rem;
    min-width: 320px;
    max-width: 90vw;
    pointer-events: auto;
    transform: translateY(-100px);
    opacity: 0;
    transition: all 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

.toast-notification.show {
    transform: translateY(0);
    opacity: 1;
}

.toast-notification.hide {
    transform: translateY(-100px);
    opacity: 0;
}

/* Tipos de toast con gradientes chulos */
.toast-success {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    background: linear-gradient(135deg, #11998e 0%, #38ef7d 100%);
}

.toast-error {
    background: linear-gradient(135deg, #ff6b6b 0%, #ee5a24 100%);
}

.toast-warning {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    background: linear-gradient(135deg, #ffecd2 0%, #fcb69f 100%);
    color: #333;
}

.toast-info {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

/* Iconos del toast */
.toast-icon {
    font-size: 1.5rem;
    flex-shrink: 0;
}

.toast-content {
    flex: 1;
    font-weight: 500;
    font-size: 0.95rem;
}

.toast-close {
    background: none;
    border: none;
    color: currentColor;
    font-size: 1.2rem;
    cursor: pointer;
    opacity: 0.7;
    transition: opacity 0.2s;
    padding: 0;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.toast-close:hover {
    opacity: 1;
}

/* Animaciones chulas */
@keyframes slideInDown {
    from {
        transform: translateY(-100px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

@keyframes slideOutUp {
    from {
        transform: translateY(0);
        opacity: 1;
    }
    to {
        transform: translateY(-100px);
        opacity: 0;
    }
}

/* Responsive para móvil */
@media (max-width: 575.98px) {
    .toast-notification {
        min-width: 280px;
        padding: 0.875rem 1.25rem;
        margin-left: 1rem;
        margin-right: 1rem;
    }
    
    .toast-content {
        font-size: 0.9rem;
    }
    
    .toast-container {
        top: 10px;
        left: 0;
        right: 0;
        transform: none;
        padding: 0 1rem;
    }
}

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

/* Focus improvements for keyboard navigation */
.btn:focus,
.form-control:focus,
.form-select:focus {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

/* Loading states for mobile */
.loading-mobile {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 9999;
    background: rgba(255, 255, 255, 0.9);
    padding: 2rem;
    border-radius: 10px;
    text-align: center;
}

/* Swipe gestures hint */
.swipe-hint {
    font-size: 0.75rem;
    color: #6c757d;
    text-align: center;
    margin-top: 0.5rem;
}

@media (max-width: 575.98px) {
    .swipe-hint {
        display: block;
    }
}

@media (min-width: 576px) {
    .swipe-hint {
        display: none;
    }
}

/* Animation for page transitions */
.fade-in {
    animation: fadeIn 0.3s ease-in;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Custom scrollbar */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 10px;
}

::-webkit-scrollbar-thumb {
    background: var(--primary-color);
    border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
    background: #0b5ed7;
}

/* Centro search styles */
.cursor-pointer {
    cursor: pointer;
}

.hover-bg-light:hover {
    background-color: #f8f9fa !important;
}

#centro-results .border-bottom:last-child {
    border-bottom: none !important;
}

/* Tablas a pantalla completa */
.table-responsive {
    width: 100%;
    overflow-x: auto;
}

.card {
    width: 100%;
}

.row {
    margin-left: 0;
    margin-right: 0;
}

/* Asegurar que las tablas usen todo el ancho disponible */
@media (min-width: 1200px) {
    .container-fluid {
        max-width: 100% !important;
    }
    
    .table-responsive {
        max-width: 100%;
    }
}
