/* ===== MEJORAS RESPONSIVE COMPLETAS - SISTEMA DE RIFAS ===== */

/* Variables CSS globales con colores neutrales */
:root {
    --primary-color: #4a5568;
    --secondary-color: #718096;
    --success-color: #38a169;
    --info-color: #4299e1;
    --warning-color: #d69e2e;
    --danger-color: #e53e3e;
    --dark-color: #2d3748;
    --light-color: #f7fafc;
    --border-radius: 0.75rem;
    --box-shadow: 0 0.15rem 1.75rem 0 rgba(58, 59, 69, 0.10);
    --box-shadow-hover: 0 0.5rem 2rem 0 rgba(58, 59, 69, 0.18);
    --transition: all 0.3s ease;
}

/* ===== MEJORAS GENERALES ===== */

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

html {
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
}

    body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: hidden;
}

/* ===== MEJORAS PARA NAVBAR ===== */

.navbar {
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    transition: var(--transition);
}

.navbar-brand {
    font-weight: 700;
    letter-spacing: 0.5px;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.navbar-brand img {
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, 0.8);
    transition: var(--transition);
}

.navbar-brand:hover img {
    border-color: #fff;
    transform: scale(1.05);
}

.navbar-toggler {
    border: none;
    padding: 0.5rem;
    border-radius: 0.5rem;
    background: rgba(255, 255, 255, 0.1);
    transition: var(--transition);
}

.navbar-toggler:focus {
    box-shadow: none;
    background: rgba(255, 255, 255, 0.2);
}

.navbar-collapse {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border-radius: 0.75rem;
    margin-top: 0.5rem;
    padding: 1rem;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.nav-link {
    font-weight: 500;
    padding: 0.75rem 1rem !important;
    border-radius: 0.5rem;
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin: 0.25rem 0;
}

.nav-link:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: translateY(-1px);
}

.nav-link i {
    font-size: 1.1rem;
    width: 1.2rem;
    text-align: center;
}

/* ===== MEJORAS PARA CARDS ===== */

    .card {
    border: none;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    transition: var(--transition);
    overflow: hidden;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
}

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

.card-header {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    color: white;
    border: none;
    padding: 1rem 1.5rem;
    font-weight: 600;
    }
    
    .card-body {
    padding: 1.5rem;
}

.card-footer {
    background: rgba(0, 0, 0, 0.02);
    border-top: 1px solid rgba(0, 0, 0, 0.05);
    padding: 1rem 1.5rem;
}

/* ===== MEJORAS PARA BOTONES ===== */

    .btn {
    border-radius: var(--border-radius);
    padding: 0.75rem 1.5rem;
    font-weight: 600;
    letter-spacing: 0.5px;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    text-decoration: none;
    border: none;
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

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

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

.btn-primary {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    color: white;
}

.btn-primary:hover {
    background: linear-gradient(135deg, #3a3f9a 0%, #7a7ff0 100%);
    transform: translateY(-2px);
    box-shadow: 0 0.5rem 1rem rgba(78, 84, 200, 0.3);
}

.btn-success {
    background: linear-gradient(135deg, var(--success-color) 0%, #17a673 100%);
    color: white;
}

.btn-success:hover {
    background: linear-gradient(135deg, #17a673 0%, #13855c 100%);
    transform: translateY(-2px);
    box-shadow: 0 0.5rem 1rem rgba(28, 200, 138, 0.3);
}

.btn-warning {
    background: linear-gradient(135deg, var(--warning-color) 0%, #f39c12 100%);
    color: white;
}

.btn-danger {
    background: linear-gradient(135deg, var(--danger-color) 0%, #c0392b 100%);
    color: white;
}

/* ===== MEJORAS PARA FORMULARIOS ===== */

.form-control, .form-select {
    border-radius: var(--border-radius);
    border: 2px solid #e9ecef;
    padding: 0.75rem 1rem;
    font-size: 1rem;
    transition: var(--transition);
    background: rgba(255, 255, 255, 0.9);
}

.form-control:focus, .form-select:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.2rem rgba(78, 84, 200, 0.15);
    background: white;
}

.form-label {
    font-weight: 600;
    color: var(--dark-color);
    margin-bottom: 0.5rem;
}

/* ===== MEJORAS PARA TABLAS ===== */

.table {
    border-radius: var(--border-radius);
    overflow: hidden;
    box-shadow: var(--box-shadow);
    background: white;
}

.table th {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    color: white;
    font-weight: 600;
    border: none;
    padding: 1rem 0.75rem;
    text-align: center;
}

.table td {
    padding: 1rem 0.75rem;
    vertical-align: middle;
    border-color: rgba(0, 0, 0, 0.05);
}

.table-striped > tbody > tr:nth-of-type(odd) {
    background-color: rgba(78, 84, 200, 0.02);
}

.table-hover > tbody > tr:hover {
    background-color: rgba(78, 84, 200, 0.05);
}

/* ===== MEJORAS PARA ALERTAS ===== */

.alert {
    border-radius: var(--border-radius);
    border: none;
    padding: 1rem 1.5rem;
    font-weight: 500;
    box-shadow: var(--box-shadow);
    backdrop-filter: blur(10px);
}

.alert-success {
    background: linear-gradient(135deg, rgba(28, 200, 138, 0.1) 0%, rgba(23, 166, 115, 0.1) 100%);
    color: #155724;
    border-left: 4px solid var(--success-color);
}

.alert-danger {
    background: linear-gradient(135deg, rgba(231, 74, 59, 0.1) 0%, rgba(192, 57, 43, 0.1) 100%);
    color: #721c24;
    border-left: 4px solid var(--danger-color);
}

.alert-warning {
    background: linear-gradient(135deg, rgba(246, 194, 62, 0.1) 0%, rgba(243, 156, 18, 0.1) 100%);
    color: #856404;
    border-left: 4px solid var(--warning-color);
}

.alert-info {
    background: linear-gradient(135deg, rgba(54, 185, 204, 0.1) 0%, rgba(52, 152, 219, 0.1) 100%);
    color: #0c5460;
    border-left: 4px solid var(--info-color);
}

/* ===== MEJORAS PARA PROGRESO ===== */

.progress {
    height: 12px;
    border-radius: 6px;
    background-color: #e9ecef;
    overflow: hidden;
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.1);
}

.progress-bar {
    background: linear-gradient(90deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    border-radius: 6px;
    transition: width 0.6s ease;
}

/* ===== MEJORAS PARA BADGES ===== */

.badge {
    font-weight: 600;
    padding: 0.5rem 0.75rem;
    border-radius: 0.5rem;
    font-size: 0.85rem;
}

.badge-primary {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
}

.badge-success {
    background: linear-gradient(135deg, var(--success-color) 0%, #17a673 100%);
}

/* ===== MEJORAS PARA MODALES ===== */

.modal-content {
    border-radius: var(--border-radius);
    border: none;
    box-shadow: var(--box-shadow-hover);
    backdrop-filter: blur(10px);
}

.modal-header {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    color: white;
    border-bottom: none;
    border-radius: var(--border-radius) var(--border-radius) 0 0;
}

.modal-footer {
    border-top: 1px solid rgba(0, 0, 0, 0.05);
    background: rgba(0, 0, 0, 0.02);
}

/* ===== MEJORAS PARA FOOTER ===== */

.footer {
    background: linear-gradient(135deg, var(--dark-color) 0%, #2c3e50 100%);
    color: white;
    padding: 2rem 0;
    margin-top: auto;
    box-shadow: 0 -0.15rem 1.75rem 0 rgba(58, 59, 69, 0.10);
}

.footer .text-muted {
    color: rgba(255, 255, 255, 0.7) !important;
}

/* ===== MEJORAS ESPECÍFICAS PARA RIFAS ===== */

.rifa-card {
    height: 100%;
    display: flex;
    flex-direction: column;
    transition: var(--transition);
}

    .rifa-card .card-img-top {
    height: 200px;
    object-fit: cover;
    transition: var(--transition);
}

.rifa-card:hover .card-img-top {
    transform: scale(1.05);
}

.rifa-card .card-body {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.rifa-card .card-footer {
    margin-top: auto;
    }
    
    .action-buttons {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
    }
    
    .action-buttons .btn {
    flex: 1;
    min-width: 120px;
}

/* ===== MEJORAS PARA ESTADÍSTICAS ===== */

.stats-card {
    text-align: center;
    padding: 1.5rem;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.9) 0%, rgba(255, 255, 255, 0.7) 100%);
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    transition: var(--transition);
}

.stats-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--box-shadow-hover);
    }
    
    .stats-card h4 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    }
    
    .stats-card small {
    font-size: 0.9rem;
    color: #495057;
    font-weight: 600;
}

/* ===== MEJORAS PARA BANNER DE EMPRESA ===== */

.empresa-info {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.95) 0%, rgba(255, 255, 255, 0.85) 100%);
    border-radius: var(--border-radius);
    padding: 2rem;
    margin-bottom: 2rem;
    box-shadow: var(--box-shadow);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.empresa-info h1 {
    font-weight: 700;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* ===== MEJORAS PARA SIDEBAR ADMIN ===== */

.sidebar {
    background: linear-gradient(180deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    min-height: 100vh;
    box-shadow: var(--box-shadow);
    position: sticky;
    top: 0;
}

.sidebar .nav-link {
    color: rgba(255, 255, 255, 0.8);
    padding: 1rem 1.5rem;
    margin: 0.25rem 0;
    border-radius: 0.5rem;
    transition: var(--transition);
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.sidebar .nav-link:hover,
.sidebar .nav-link.active {
    color: #fff;
    background: rgba(255, 255, 255, 0.15);
    transform: translateX(5px);
    box-shadow: 0 0.25rem 0.5rem rgba(0, 0, 0, 0.1);
}

.sidebar .nav-link i {
    width: 1.5rem;
    text-align: center;
    font-size: 1.1rem;
}

/* ===== RESPONSIVE DESIGN - MÓVILES ===== */

@media (max-width: 576px) {
    /* Ajustes generales */
    body {
        font-size: 14px;
    }
    
    .container, .container-fluid {
        padding-left: 10px;
        padding-right: 10px;
    }
    
    /* Navbar móvil */
    .navbar-brand {
        font-size: 1.1rem;
        max-width: 70%;
    }
    
    .navbar-brand img {
        max-width: 30px;
        max-height: 30px;
    }
    
    .navbar-collapse {
        margin-top: 0.5rem;
        padding: 0.75rem;
    }
    
    .nav-link {
        font-size: 0.9rem;
        padding: 0.75rem !important;
        justify-content: center;
    }
    
    .nav-link span {
        display: none;
    }
    
    .nav-link i {
        font-size: 1.2rem;
        margin: 0;
    }
    
    /* Cards móviles */
    .card {
        margin-bottom: 1rem;
        border-radius: 0.5rem;
    }
    
    .card-body {
        padding: 1rem;
    }
    
    .card-header {
        padding: 0.75rem 1rem;
    }
    
    /* Botones móviles */
    .btn {
        padding: 0.75rem 1rem;
        font-size: 0.9rem;
        border-radius: 0.5rem;
        min-height: 44px;
    }
    
    .action-buttons {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .action-buttons .btn {
        width: 100%;
    }
    
    /* Formularios móviles */
    .form-control, .form-select {
        font-size: 16px;
        padding: 0.75rem;
    }
    
    /* Tablas móviles */
    .table {
        font-size: 0.8rem;
    }
    
    .table th, .table td {
        padding: 0.5rem 0.25rem;
    }
    
    /* Alertas móviles */
    .alert {
        padding: 0.75rem;
        font-size: 0.9rem;
    }
    
    /* Estadísticas móviles */
    .stats-card {
        padding: 1rem;
    }
    
    .stats-card h4 {
        font-size: 1.8rem;
    }
    
    .stats-card small {
        font-size: 0.8rem;
    }
    
    /* Banner empresa móvil */
    .empresa-info {
        padding: 1rem;
        text-align: center;
    }
    
    .empresa-info h1 {
        font-size: 1.5rem;
    }
    
    .empresa-info .row {
        flex-direction: column;
    }
    
    .empresa-info .col-md-4 {
        margin-top: 1rem;
    }
    
    /* Imágenes móviles */
    .rifa-card .card-img-top {
        height: 150px;
    }
    
    /* Progreso móvil */
    .progress {
        height: 8px;
    }
    
    /* Iconos móviles */
    .fa-3x {
        font-size: 2rem;
    }
    
    .fa-2x {
        font-size: 1.5rem;
    }
    
    /* Headings móviles */
    h1 { font-size: 1.6rem; }
    h2 { font-size: 1.4rem; }
    h3 { font-size: 1.2rem; }
    h4 { font-size: 1.1rem; }
    h5 { font-size: 1rem; }
    
    /* Espaciado móvil */
    .mb-3 { margin-bottom: 0.75rem !important; }
    .mb-4 { margin-bottom: 1rem !important; }
    .mt-3 { margin-top: 0.75rem !important; }
    .mt-4 { margin-top: 1rem !important; }
    .mt-5 { margin-top: 1.5rem !important; }
    .py-4 { padding: 1rem 0 !important; }
    .py-5 { padding: 1.5rem 0 !important; }
    
    /* Grid móvil */
    .row {
        margin-left: -5px;
        margin-right: -5px;
    }
    
    .col, .col-1, .col-2, .col-3, .col-4, .col-5, .col-6, .col-7, .col-8, .col-9, .col-10, .col-11, .col-12,
    .col-sm, .col-sm-1, .col-sm-2, .col-sm-3, .col-sm-4, .col-sm-5, .col-sm-6, .col-sm-7, .col-sm-8, .col-sm-9, .col-sm-10, .col-sm-11, .col-sm-12,
    .col-md, .col-md-1, .col-md-2, .col-md-3, .col-md-4, .col-md-5, .col-md-6, .col-md-7, .col-md-8, .col-md-9, .col-md-10, .col-md-11, .col-md-12,
    .col-lg, .col-lg-1, .col-lg-2, .col-lg-3, .col-lg-4, .col-lg-5, .col-lg-6, .col-lg-7, .col-lg-8, .col-lg-9, .col-lg-10, .col-lg-11, .col-lg-12 {
        padding-left: 5px;
        padding-right: 5px;
}

    /* Flexbox móvil */
    .d-flex {
        flex-direction: column;
    }
    
    .d-flex.flex-row {
        flex-direction: row;
    }
    
    /* Footer móvil */
    .footer {
        padding: 1rem 0;
        text-align: center;
    }
    
    .footer .text-end {
        text-align: center !important;
        margin-top: 0.5rem;
    }
}

/* ===== RESPONSIVE DESIGN - TABLETS ===== */

@media (min-width: 577px) and (max-width: 768px) {
    .container, .container-fluid {
        padding-left: 15px;
        padding-right: 15px;
    }
    
    .card-body {
        padding: 1.25rem;
    }
    
    .btn {
        padding: 0.6rem 1.25rem;
        font-size: 0.95rem;
    }
    
    .navbar-brand {
        font-size: 1.2rem;
    }
    
    .nav-link {
        font-size: 0.95rem;
    }
    
    .stats-card h4 {
        font-size: 2rem;
    }
    
    .empresa-info {
        padding: 1.5rem;
    }
}

/* ===== RESPONSIVE DESIGN - DESKTOP ===== */

@media (min-width: 769px) {
    .container {
        max-width: 1200px;
    }
    
    .card:hover {
        transform: translateY(-6px);
    }
    
    .btn:hover {
        transform: translateY(-2px);
    }
    
    .navbar-nav .nav-link {
        margin: 0 0.25rem;
    }
    
    .sidebar .nav-link:hover {
        transform: translateX(8px);
    }
}

/* ===== MEJORAS PARA ORIENTACIÓN LANDSCAPE ===== */

@media (max-width: 768px) and (orientation: landscape) {
    .navbar {
        padding: 0.25rem 0;
    }
    
    .main-content {
        padding: 0.5rem 0;
    }
    
    .card {
        margin-bottom: 0.75rem;
    }
    
    .empresa-info {
        padding: 1rem;
        margin-bottom: 1rem;
    }
}

/* ===== MEJORAS PARA ACCESIBILIDAD ===== */

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

@media (prefers-color-scheme: dark) {
    :root {
        --light-color: #2c3e50;
    }
    
    body {
        background: linear-gradient(135deg, #2c3e50 0%, #34495e 100%);
        color: #ecf0f1;
    }
    
    .card {
        background: rgba(52, 73, 94, 0.95);
        color: #ecf0f1;
    }
}

/* ===== ANIMACIONES Y EFECTOS ===== */

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

@keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translateX(-30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes pulse {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
    100% {
        transform: scale(1);
    }
}

.fade-in-up {
    animation: fadeInUp 0.6s ease-out;
}

.slide-in-left {
    animation: slideInLeft 0.6s ease-out;
}

.pulse {
    animation: pulse 2s infinite;
}

/* ===== MEJORAS PARA TOUCH ===== */

@media (hover: none) and (pointer: coarse) {
    .btn:hover {
        transform: none;
    }
    
    .card:hover {
        transform: none;
    }
    
    .nav-link:hover {
        transform: none;
    }
    
    .btn:active {
        transform: scale(0.98);
    }
    
    .card:active {
        transform: scale(0.98);
    }
}

/* ===== MEJORAS PARA IMPRESIÓN ===== */

@media print {
    .navbar, .footer, .btn, .sidebar {
        display: none !important;
    }
    
    .card {
        box-shadow: none;
        border: 1px solid #ddd;
    }
    
    body {
        background: white;
        color: black;
    }
}

/* ===== MEJORAS PARA HIGH DPI DISPLAYS ===== */

@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    .card {
        border-width: 0.5px;
    }
    
    .btn {
        border-width: 0.5px;
    }
}

/* ===== MEJORAS PARA FOCUS VISIBLE ===== */

.btn:focus-visible,
.nav-link:focus-visible,
.form-control:focus-visible {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

/* ===== MEJORAS PARA LOADING STATES ===== */

.btn-loading {
    position: relative;
    color: transparent !important;
}

.btn-loading::after {
    content: '';
    position: absolute;
    width: 16px;
    height: 16px;
    top: 50%;
    left: 50%;
    margin-left: -8px;
    margin-top: -8px;
    border: 2px solid transparent;
    border-top-color: currentColor;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* ===== MEJORAS PARA SCROLLBAR ===== */

::-webkit-scrollbar {
    width: 8px;
}

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

::-webkit-scrollbar-thumb {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(135deg, #1d4ed8 0%, #2563eb 100%);
}

/* ===== MEJORAS PARA SELECTION ===== */

::selection {
    background: rgba(37, 99, 235, 0.3);
    color: inherit;
}

::-moz-selection {
    background: rgba(37, 99, 235, 0.3);
    color: inherit;
} 