:root {
    /* Paleta Institucional Mejorada */
    --primary-color: #581845;
    --primary-dark: #7e0f2e;
    --primary-light: #7E243B;
    --secondary-color: #D4AF37;
    --secondary-light: #F0D67A;
    --secondary-dark: #B8941E;
    --white: #ffffff;
    --gray-light: #F8F9FA;
    --gray-mid: #E2E8F0;
    --text-dark: #000000;
    --text-muted: #64748B;

    /* Sombras Mejoradas */
    --shadow-sm: 0 1px 2px 0 rgba(255, 250, 250, 0.05);
    --shadow-md: 0 4px 6px -1px rgb(255, 253, 253), 0 2px 4px -1px rgb(255, 251, 251);
    --shadow-lg: 0 10px 15px -3px rgba(255, 251, 251, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --shadow-xl: 0 20px 25px -5px rgb(255, 239, 239), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    --shadow-2xl: 0 25px 50px -12px rgba(255, 255, 255, 0.25);

    /* Transiciones */
    --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-base: 300ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: 500ms cubic-bezier(0.4, 0, 0.2, 1);

    /* Variables Responsive */
    --container-padding: 1rem;
    --header-height: 70px;
}

/* Reset y Base Mejorada */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    font-size: 16px;
}

@media (max-width: 768px) {
    html {
        font-size: 14px;
    }
}

body {
    font-family: 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background-color: var(--gray-light);
    background-image: linear-gradient(135deg, rgba(255, 255, 255, 0.95), rgba(255, 255, 255, 0.98)), url('../img/fondo.png');
    background-size: cover;
    background-attachment: fixed;
    background-position: center;
    min-height: 100vh;
    line-height: 1.5;
    color: var(--text-dark);
}

/* Scrollbar Personalizada */
::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

::-webkit-scrollbar-track {
    background: var(--gray-light);
    border-radius: 10px;
}

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

::-webkit-scrollbar-thumb:hover {
    background: var(--primary-color);
}

/* Wrapper */
.wrapper {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
}

/* Hero Section Mejorada */
.hero-section {
    background: linear-gradient(135deg, rgba(58, 15, 27, 0.92), rgba(88, 24, 69, 0.88)), url('../img/fondo.png');
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    padding: clamp(60px, 10vw, 120px) 0 clamp(80px, 12vw, 140px);
    margin-bottom: -50px;
    border-radius: 0 0 clamp(30px, 5vw, 50px) clamp(30px, 5vw, 50px);
    border-bottom: 4px solid var(--secondary-color);
    position: relative;
    overflow: hidden;
}

.hero-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(circle at 20% 40%, rgba(212, 175, 55, 0.1), transparent 70%);
    pointer-events: none;
}

.hero-section::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, transparent, var(--secondary-color), var(--secondary-light), var(--secondary-color), transparent);
}

.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: linear-gradient(135deg, var(--secondary-color), var(--secondary-dark));
    padding: 0.5rem 1.5rem;
    border-radius: 50px;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--white);
    margin-bottom: 1.5rem;
    animation: float 3s ease-in-out infinite;
    box-shadow: var(--shadow-lg);
    backdrop-filter: blur(10px);
}

.hero-badge i {
    font-size: 1rem;
}

.hero-title {
    color: var(--white);
    font-size: clamp(2rem, 6vw, 3.5rem);
    font-weight: 800;
    margin-bottom: 1rem;
    line-height: 1.2;
    text-shadow: 0 2px 10px rgba(255, 255, 255, 0.2);
}

.gradient-text {
    background: linear-gradient(135deg, var(--secondary-light), var(--secondary-color), var(--secondary-dark));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: gradientShift 3s ease infinite;
}

.hero-subtitle {
    color: rgba(255, 255, 255, 0.95);
    font-size: clamp(0.875rem, 4vw, 1.125rem);
    max-width: 600px;
    margin: 0 auto;
    line-height: 1.6;
}

/* Margen Negativo Responsive */
.mt-n5 {
    margin-top: clamp(-40px, -8vw, -60px) !important;
}

/* Form Card Mejorada */
.form-card {
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(10px);
    border-radius: clamp(20px, 5vw, 30px);
    box-shadow: var(--shadow-2xl);
    overflow: hidden;
    transition: var(--transition-base);
    border: 1px solid rgba(212, 175, 55, 0.2);
}

.form-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 30px 40px -15px rgba(255, 254, 254, 0.807);
}

.form-card-header {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    padding: clamp(1.5rem, 4vw, 2rem);
    position: relative;
    overflow: hidden;
}

card,
.form-card,
.stat-card,
.login-card {
    border: none;
    border-radius: 16px;
    margin-bottom: 1.5rem;
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275), box-shadow 0.3s ease;
    animation: fadeIn 0.8s ease-out;
    /* Efecto Transparente (Glassmorphism) */
    background: rgba(255, 255, 255, 0.15) !important;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.3) !important;
    box-shadow: 0 8px 32px 0 rgba(246, 245, 245, 0.202) !important;
}

.card:hover,
.form-card:hover {
    transform: translateY(-5px);
}



.form-card-header h3 {
    font-weight: 700;
    font-size: clamp(1.25rem, 4vw, 1.5rem);
    margin: 0;
    position: relative;
    z-index: 1;
}

.form-card-header p {
    margin-top: 0.5rem;
    opacity: 0.9;
    font-size: 0.875rem;
    position: relative;
    z-index: 1;
}

.form-card form {
    padding: clamp(1.5rem, 5vw, 2rem);
}

/* Form Controls Mejorados */
.form-label {
    font-weight: 600;
    color: #000000 !important;
    margin-bottom: 0.5rem;
    font-size: 0.875rem;
}

.form-control,
.form-select {
    border-radius: 12px;
    border: 2px solid var(--gray-mid);
    padding: 0.75rem 1rem;
    transition: var(--transition-fast);
    font-size: 0.875rem;
}

.form-control:focus,
.form-select:focus {
    border-color: var(--secondary-color);
    box-shadow: 0 0 0 4px rgba(212, 175, 55, 0.2);
    outline: none;
}

.form-control:hover,
.form-select:hover {
    border-color: var(--secondary-light);
}

/* Button Mejorado */
.btn-submit {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    color: var(--white);
    border: none;
    padding: 0.875rem 2rem;
    border-radius: 50px;
    font-weight: 700;
    font-size: 1rem;
    transition: var(--transition-base);
    position: relative;
    overflow: hidden;
    width: 100%;
}

@media (min-width: 768px) {
    .btn-submit {
        width: auto;
        min-width: 200px;
    }
}

.btn-submit::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.btn-submit:hover::before {
    width: 300px;
    height: 300px;
}

.btn-submit:hover {
    background: linear-gradient(135deg, var(--secondary-dark), var(--secondary-color));
    transform: translateY(-2px);
    box-shadow: var(--shadow-xl);
}

/* Info Cards Mejoradas */
.info-cards {
    margin-top: 2rem;
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
}

.info-item {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 16px;
    padding: 1rem;
    text-align: center;
    transition: var(--transition-base);
    border: 1px solid rgba(212, 175, 55, 0.2);
    flex: 1;
    min-width: 100px;
}

.info-item:hover {
    transform: translateY(-5px) scale(1.05);
    box-shadow: var(--shadow-lg);
    border-color: var(--secondary-color);
}

.info-item i {
    font-size: clamp(1.5rem, 5vw, 2rem);
    color: var(--secondary-color);
    display: block;
    margin-bottom: 0.5rem;
}

.info-item span {
    font-weight: 600;
    font-size: 0.75rem;
    color: var(--text-dark);
}

@media (min-width: 768px) {
    .info-item span {
        font-size: 0.875rem;
    }
}

/* Admin Login Mejorado */
.login-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    position: relative;
    overflow: hidden;
}

.login-container::before {
    content: '';
    position: absolute;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(212, 175, 55, 0.1), transparent);
    animation: rotate 30s linear infinite;
}

.login-card {
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(10px);
    border-radius: clamp(20px, 5vw, 30px);
    padding: clamp(1.5rem, 5vw, 2.5rem);
    width: 100%;
    max-width: 450px;
    box-shadow: var(--shadow-2xl);
    position: relative;
    z-index: 1;
}

.login-header {
    text-align: center;
    margin-bottom: 2rem;
}

.login-header i {
    font-size: clamp(2.5rem, 8vw, 3.5rem);
    color: var(--secondary-color);
    animation: float 3s ease-in-out infinite;
}

.btn-login {
    width: 100%;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    color: var(--white);
    border: none;
    padding: 0.875rem;
    border-radius: 12px;
    font-weight: 700;
    transition: var(--transition-base);
}

.btn-login:hover {
    background: linear-gradient(135deg, var(--secondary-dark), var(--secondary-color));
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

/* Admin Navbar */
.admin-navbar {
    background: var(--primary-dark);
    padding: 1rem 0;
    color: var(--white);
    border-bottom: 3px solid var(--secondary-color);
    position: sticky;
    top: 0;
    z-index: 1000;
    backdrop-filter: blur(10px);
}

.btn-logout {
    background: rgba(255, 255, 255, 0.1);
    color: var(--white);
    padding: 0.5rem 1.25rem;
    border-radius: 50px;
    text-decoration: none;
    transition: var(--transition-fast);
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-logout:hover {
    background: var(--secondary-color);
    color: var(--primary-dark);
    transform: translateY(-2px);
}

/* Ocultar enlaces de navegación Inicio y Administrador */
.navbar-institucional .nav-link {
    display: none !important;
}

/* Stats Cards Mejoradas */
.stat-card {
    background: var(--white);
    border-radius: 20px;
    padding: 1.5rem;
    text-align: center;
    box-shadow: var(--shadow-md);
    transition: var(--transition-base);
    cursor: pointer;
}

.stat-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-xl);
}

.stat-icon i {
    font-size: 2.5rem;
    transition: var(--transition-base);
}

.stat-card:hover .stat-icon i {
    transform: scale(1.1);
}

.stat-number {
    font-size: 2rem;
    font-weight: 800;
    color: var(--text-dark);
    margin-top: 0.5rem;
}

.stat-card.stat-total .stat-icon i {
    color: var(--primary-color);
}

.stat-card.stat-felicidad .stat-icon i {
    color: #10B981;
}

.stat-card.stat-queja .stat-icon i {
    color: #EF4444;
}

.stat-card.stat-pendiente .stat-icon i {
    color: var(--secondary-color);
}

/* Badges Mejorados */
.badge-tipo {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.25rem 0.75rem;
    border-radius: 50px;
    font-size: 0.75rem;
    font-weight: 600;
    transition: var(--transition-fast);
}

.tipo-felicitacion {
    background: #D1FAE5;
    color: #065F46;
}

.tipo-recomendacion {
    background: #DBEAFE;
    color: #1E40AF;
}

.tipo-sugerencia {
    background: #FEF3C7;
    color: #92400E;
}

.tipo-queja {
    background: #FEE2E2;
    color: #991B1B;
}

/* Action Buttons */
.btn-action {
    background: none;
    border: none;
    padding: 0.5rem;
    border-radius: 8px;
    cursor: pointer;
    transition: var(--transition-fast);
    font-size: 1.1rem;
}

.btn-marcar {
    color: #10B981;
}

.btn-responder {
    color: var(--secondary-color);
}

.btn-eliminar {
    color: #EF4444;
}

.btn-action:hover {
    transform: scale(1.1);
    background: rgba(0, 0, 0, 0.05);
}

/* Footer Mejorado */
.footer-institucional {
    background: transparent;
    margin-top: auto;
    border-top: 4px solid var(--secondary-color);
    padding: 0;
    text-align: center;
    position: relative;
    width: 100%;
}

.footer-institucional img {
    width: 100%;
    max-width: 100%;
    height: auto;
    display: block;
    margin: 0;
    padding: 0;
    transition: var(--transition-base);
}

.footer-institucional img:hover {
    filter: brightness(1.05);
}

/* DataTables Text Colors to Black */
.dataTables_wrapper,
.dataTables_info,
.dataTables_paginate,
.dataTables_length,
.dataTables_filter,
table.dataTable,
.table-header h5,
.table {
    color: #000000 !important;
}

.dataTables_wrapper label {
    color: #000000 !important;
}

/* Animaciones Mejoradas */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes float {

    0%,
    100% {
        transform: translateY(0px);
    }

    50% {
        transform: translateY(-10px);
    }
}

@keyframes gradientShift {

    0%,
    100% {
        background-position: 0% 50%;
    }

    50% {
        background-position: 100% 50%;
    }
}

@keyframes rotate {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

@keyframes shimmer {
    0% {
        background-position: -1000px 0;
    }

    100% {
        background-position: 1000px 0;
    }
}

/* Loading State */
.btn-submit.loading {
    position: relative;
    color: transparent;
}

.btn-submit.loading::after {
    content: '';
    position: absolute;
    width: 20px;
    height: 20px;
    top: 50%;
    left: 50%;
    margin-left: -10px;
    margin-top: -10px;
    border: 2px solid var(--white);
    border-top-color: transparent;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Responsive Grid System */
@media (max-width: 768px) {
    .container {
        padding-left: var(--container-padding);
        padding-right: var(--container-padding);
    }

    /* Mejoras para tablas en móvil */
    .table-responsive {
        display: block;
        width: 100%;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    /* Cards en móvil */
    .row>[class*="col-"] {
        margin-bottom: 1rem;
    }

    /* Navbar móvil */
    .navbar-collapse {
        background: var(--primary-dark);
        padding: 1rem;
        border-radius: 12px;
        margin-top: 1rem;
    }
}

/* Touch Device Optimizations */
@media (hover: none) and (pointer: coarse) {
    .btn-submit:hover {
        transform: none;
    }

    .stat-card:hover {
        transform: none;
    }

    .info-item:hover {
        transform: none;
    }

    /* Mejorar touch targets */
    button,
    .btn-action,
    .btn-logout,
    .nav-link {
        min-height: 44px;
        min-width: 44px;
    }
}

/* Print Styles */
@media print {

    .hero-section,
    .btn-submit,
    .footer-institucional,
    .admin-navbar {
        display: none;
    }

    .form-card {
        box-shadow: none;
        border: 1px solid #ddd;
    }
}

/* Accessibility */
@media (prefers-reduced-motion: reduce) {

    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

/* Dark Mode Support */
@media (prefers-color-scheme: dark) {
    :root {
        --gray-light: #ffffff;
        --white: #ffffff;
        --text-dark: #e2e8f0;
        --text-muted: #94a3b8;
        --gray-mid: #334155;
    }

    body {
        background-image: linear-gradient(135deg, rgba(240, 235, 235, 0.95), rgba(255, 255, 255, 0.274)), url('../img/fondo.png');
    }

    .form-card,
    .stat-card,
    .login-card {
        background: rgba(30, 30, 46, 0.98);
    }
}