/* =====================================================
   Portal de Clientes - Kirichenko S.A.
   Estilos personalizados
   ===================================================== */

/* --- Base --- */
body {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}
main {
    flex: 1;
}

/* --- Login --- */
.login-gradient {
    background: linear-gradient(135deg, #1e3a8a 0%, #1e40af 50%, #2563eb 100%);
}
.dark .login-gradient {
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
}
.input-portal {
    background-color: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: white;
    transition: all 0.2s;
}
.input-portal::placeholder {
    color: rgba(255, 255, 255, 0.5);
}
.input-portal:focus {
    background-color: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.4);
    box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.1);
    outline: none;
}
.input-portal:-webkit-autofill,
.input-portal:-webkit-autofill:hover,
.input-portal:-webkit-autofill:focus {
    -webkit-text-fill-color: #1e3a8a;
    -webkit-box-shadow: 0 0 0px 1000px #dbeafe inset;
}

/* --- Cards --- */
.stat-card {
    transition: transform 0.2s, box-shadow 0.2s;
}
.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
}

/* --- Photo Gallery --- */
.photo-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1rem;
}
@media (max-width: 640px) {
    .photo-grid {
        grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
        gap: 0.5rem;
    }
}
.photo-card {
    position: relative;
    overflow: hidden;
    border-radius: 0.75rem;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    aspect-ratio: 4 / 3;
    background: #f1f5f9;
}
.dark .photo-card {
    background: #1e293b;
}
.photo-card:hover {
    transform: scale(1.02);
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.15);
}
.photo-card img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s;
}
.photo-card:hover img {
    transform: scale(1.05);
}
.photo-card .photo-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(transparent, rgba(0, 0, 0, 0.7));
    padding: 2rem 0.75rem 0.75rem;
    opacity: 0;
    transition: opacity 0.2s;
}
.photo-card:hover .photo-overlay {
    opacity: 1;
}

/* --- Lightbox --- */
.lightbox-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.95);
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s, visibility 0.3s;
}
.lightbox-overlay.active {
    opacity: 1;
    visibility: visible;
}
.lightbox-overlay img {
    max-width: 90vw;
    max-height: 85vh;
    object-fit: contain;
    border-radius: 0.5rem;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
}
.lightbox-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: white;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.2s;
}
.lightbox-nav:hover {
    background: rgba(255, 255, 255, 0.2);
}
.lightbox-info {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(transparent, rgba(0, 0, 0, 0.8));
    padding: 3rem 1.5rem 1.5rem;
    color: white;
}

/* --- Status Badges --- */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.025em;
}

/* --- Print styles --- */
@media print {
    nav, footer, .admin-banner, .no-print, .lightbox-overlay { display: none !important; }
    body { background: white !important; color: black !important; }
    main { padding: 0 !important; max-width: 100% !important; }
    .photo-grid { grid-template-columns: repeat(3, 1fr) !important; }
    .photo-card { break-inside: avoid; page-break-inside: avoid; }
    .photo-card .photo-overlay { opacity: 1 !important; }
    .stat-card { box-shadow: none !important; border: 1px solid #e2e8f0 !important; }
    * { -webkit-print-color-adjust: exact !important; print-color-adjust: exact !important; }
}

/* --- Animations --- */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}
.animate-fade-in {
    animation: fadeIn 0.4s ease-out;
}
@keyframes shake {
    0%, 100% { transform: translateX(0); }
    10%, 30%, 50%, 70%, 90% { transform: translateX(-4px); }
    20%, 40%, 60%, 80% { transform: translateX(4px); }
}
.shake { animation: shake 0.5s ease-in-out; }

/* --- Section headers --- */
.section-divider {
    display: flex;
    align-items: center;
    gap: 1rem;
}
.section-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: linear-gradient(to right, #cbd5e1, transparent);
}
.dark .section-divider::after {
    background: linear-gradient(to right, #475569, transparent);
}

/* --- DataTable overrides for portal --- */
#tablaServicios,
.dataTables_wrapper {
    width: 100% !important;
}
.dataTables_wrapper .dataTables_filter input {
    border: 1px solid #e2e8f0;
    border-radius: 0.5rem;
    padding: 0.5rem 0.75rem;
    font-size: 0.875rem;
}
.dataTables_wrapper .dataTables_length select {
    border: 1px solid #e2e8f0;
    border-radius: 0.5rem;
    padding: 0.35rem 1.5rem 0.35rem 0.5rem;
    font-size: 0.875rem;
}
.dataTables_wrapper .dataTables_info,
.dataTables_wrapper .dataTables_length,
.dataTables_wrapper .dataTables_filter,
.dataTables_wrapper .dataTables_paginate {
    padding: 0 1.25rem;
}
.dataTables_wrapper .dataTables_processing {
    background: rgba(255,255,255,0.9) !important;
    border: none !important;
    font-size: 0.875rem;
}
.dark .dataTables_wrapper .dataTables_processing {
    background: rgba(30,41,59,0.9) !important;
    color: #e2e8f0;
}
.dark .dataTables_wrapper .dataTables_filter input {
    background: #1e293b;
    border-color: #475569;
    color: #e2e8f0;
}
.dark .dataTables_wrapper .dataTables_length select {
    background: #1e293b;
    border-color: #475569;
    color: #e2e8f0;
}
.dark .dataTables_wrapper .dataTables_info,
.dark .dataTables_wrapper .dataTables_paginate {
    color: #94a3b8;
}
.dark .dataTables_wrapper .dataTables_paginate .paginate_button {
    color: #94a3b8 !important;
}
.dark .dataTables_wrapper .dataTables_paginate .paginate_button.current {
    background: #1e40af !important;
    border-color: #1e40af !important;
    color: white !important;
}
.dark .dataTables_wrapper .dataTables_paginate .paginate_button:hover {
    background: #334155 !important;
    border-color: #475569 !important;
    color: white !important;
}
