/* TopTSP - Universidad Rey Juan Carlos Styling - Modern Design */

:root {
    --urjc-red: #C41E3A;
    --urjc-dark-red: #A01729;
    --urjc-light-red: #E63952;
    --urjc-black: #1A1A1A;
    --urjc-white: #FFFFFF;
    --urjc-gray: #F5F5F5;
    --urjc-light-gray: #E8E8E8;
    --urjc-text-dark: #333333;
    --urjc-text-light: #666666;
    --shadow-sm: 0 2px 8px rgba(0,0,0,0.08);
    --shadow-md: 0 4px 16px rgba(0,0,0,0.12);
    --shadow-lg: 0 8px 32px rgba(0,0,0,0.16);
    --border-radius: 12px;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue', sans-serif;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    color: var(--urjc-text-dark);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Prevent horizontal scroll leaking off-canvas elements on mobile */
html, body {
    overflow-x: hidden;
}

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

::-webkit-scrollbar-track {
    background: var(--urjc-light-gray);
}

::-webkit-scrollbar-thumb {
    background: var(--urjc-red);
    border-radius: 6px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--urjc-dark-red);
}

/* Header */
.header {
    background: linear-gradient(135deg, var(--urjc-red) 0%, var(--urjc-dark-red) 100%);
    color: var(--urjc-white);
    padding: 1.25rem 0;
    box-shadow: 0 4px 20px rgba(196, 30, 58, 0.25);
    position: sticky;
    top: 0;
    z-index: 1200; /* Above mobile overlay to keep menu clickable */
    backdrop-filter: blur(10px);
}

.header-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.logo h1 {
    font-size: 2.2rem;
    font-weight: 700;
    margin: 0;
    letter-spacing: -0.5px;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.2);
}

.logo-subtitle {
    font-size: 0.9rem;
    opacity: 0.95;
    margin-top: 0.25rem;
    font-weight: 300;
}

.nav {
    display: flex;
    gap: 0.5rem;
}

.nav a {
    color: var(--urjc-white);
    text-decoration: none;
    padding: 0.6rem 1.2rem;
    border-radius: 8px;
    transition: var(--transition);
    font-weight: 500;
    position: relative;
    overflow: hidden;
}

.nav a::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: rgba(255,255,255,0.1);
    transition: left 0.3s ease;
}

.nav a:hover::before {
    left: 0;
}

.nav a:hover {
    background-color: rgba(255,255,255,0.15);
    transform: translateY(-2px);
}

.nav a.active {
    background-color: var(--urjc-white);
    color: var(--urjc-red);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

/* Mobile menu toggle button */
.mobile-menu-toggle {
    display: none;
    background: none;
    border: none;
    color: var(--urjc-white);
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0.5rem;
}

/* Close button in mobile menu - hidden by default */
.mobile-menu-close {
    display: none;
}

/* Mobile menu overlay - hidden by default */
.mobile-menu-overlay {
    display: none;
}

@media (max-width: 768px) {
    .mobile-menu-toggle {
        display: block;
    }

    .nav {
        position: fixed;
        top: 0;
        right: -100%;
        height: 100vh;
        width: 70%;
        max-width: 300px;
        background: linear-gradient(135deg, var(--urjc-red), var(--urjc-dark-red));
        flex-direction: column;
        gap: 0;
        padding: 4rem 0 2rem 0;
        box-shadow: -2px 0 10px rgba(0,0,0,0.3);
        transition: right 0.3s ease-in-out;
        z-index: 1100; /* Ensure above overlays/modals on mobile */
        pointer-events: auto; /* Guarantee interactivity on iOS/Android */
    }

    .nav.active {
        right: 0;
    }

    .nav a {
        padding: 1rem 2rem;
        border-radius: 0;
        width: 100%;
        text-align: left;
        border-bottom: 1px solid rgba(255,255,255,0.1);
    }

    .nav a.active {
        background-color: rgba(255,255,255,0.2);
        color: var(--urjc-white);
    }

    .header-content {
        position: relative;
    }

    /* Close button in mobile menu */
    .mobile-menu-close {
        position: absolute;
        top: 1rem;
        right: 1rem;
        background: none;
        border: none;
        color: var(--urjc-white);
        font-size: 1.5rem;
        cursor: pointer;
        padding: 0.5rem;
        display: block;
    }

    /* Overlay */
    .mobile-menu-overlay {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100vh;
        background: rgba(0,0,0,0.5);
        z-index: 999;
        pointer-events: none; /* Disabled until active */
    }

    .mobile-menu-overlay.active {
        display: block;
        pointer-events: auto; /* Enable to allow click-to-close */
    }
}

/* Main Container */
.container {
    max-width: 1200px;
    margin: 2rem auto;
    padding: 0 2rem;
    animation: fadeIn 0.6s ease-out;
}

/* Cards */
.card {
    background: var(--urjc-white);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-md);
    padding: 2.5rem;
    margin-bottom: 2rem;
    transition: var(--transition);
    border: 1px solid rgba(0,0,0,0.05);
    position: relative;
    overflow: hidden;
}

.card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: linear-gradient(90deg, var(--urjc-red), var(--urjc-light-red));
}

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

.card h2 {
    color: var(--urjc-red);
    margin-bottom: 1.5rem;
    padding-bottom: 0.75rem;
    border-bottom: 2px solid var(--urjc-light-gray);
    font-size: 1.75rem;
    font-weight: 700;
    position: relative;
}

.card h2::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 60px;
    height: 2px;
    background: var(--urjc-red);
}

.card h3 {
    color: var(--urjc-text-dark);
    margin-bottom: 0.75rem;
    font-size: 1.25rem;
    font-weight: 600;
}

/* Forms */
.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: var(--urjc-text-dark);
    font-size: 0.95rem;
}

.form-control {
    width: 100%;
    padding: 0.875rem 1rem;
    border: 2px solid var(--urjc-light-gray);
    border-radius: 8px;
    font-size: 1rem;
    transition: var(--transition);
    background-color: var(--urjc-white);
}

.form-control:focus {
    outline: none;
    border-color: var(--urjc-red);
    box-shadow: 0 0 0 3px rgba(196, 30, 58, 0.1);
    transform: translateY(-1px);
}

textarea.form-control {
    resize: vertical;
    min-height: 100px;
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 0.875rem 1.75rem;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    text-decoration: none;
    text-align: center;
    cursor: pointer;
    transition: var(--transition);
    font-weight: 600;
    position: relative;
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}

.btn::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:hover::before {
    width: 300px;
    height: 300px;
}

.btn-primary {
    background: linear-gradient(135deg, var(--urjc-red), var(--urjc-dark-red));
    color: var(--urjc-white);
}

.btn-primary:hover {
    background: linear-gradient(135deg, var(--urjc-dark-red), var(--urjc-red));
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(196, 30, 58, 0.35);
}

.btn-secondary {
    background: linear-gradient(135deg, #6c757d, #5a6268);
    color: var(--urjc-white);
}

.btn-secondary:hover {
    background: linear-gradient(135deg, #5a6268, #6c757d);
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(108, 117, 125, 0.35);
}

.btn-danger {
    background: linear-gradient(135deg, #DC3545, #C82333);
    color: var(--urjc-white);
}

.btn-danger:hover {
    background: linear-gradient(135deg, #C82333, #DC3545);
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(220, 53, 69, 0.35);
}

.btn-success {
    background: linear-gradient(135deg, #28A745, #218838);
    color: var(--urjc-white);
}

.btn-success:hover {
    background: linear-gradient(135deg, #218838, #28A745);
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(40, 167, 69, 0.35);
}

.btn-warning {
    background: linear-gradient(135deg, #ffc107, #e0a800);
    color: #212529;
}

.btn-warning:hover {
    background: linear-gradient(135deg, #e0a800, #ffc107);
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(255, 193, 7, 0.35);
}

.btn-block {
    width: 100%;
}

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

.btn-sm {
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
    border-radius: 6px;
}

/* Tables - Modern Design */
.table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    margin-top: 1.5rem;
    border-radius: var(--border-radius);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}

.table th,
.table td {
    padding: 1rem 1.25rem;
    text-align: left;
    border-bottom: 1px solid rgba(0,0,0,0.05);
}

.table th {
    background: linear-gradient(135deg, var(--urjc-red), var(--urjc-dark-red));
    color: var(--urjc-white);
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.85rem;
    letter-spacing: 0.5px;
    position: sticky;
    top: 0;
    z-index: 10;
}

.table tbody tr {
    transition: var(--transition);
    background-color: var(--urjc-white);
}

.table tbody tr:hover {
    background: linear-gradient(90deg, rgba(196, 30, 58, 0.05), transparent);
    transform: scale(1.01);
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.table tbody tr:nth-child(even) {
    background-color: rgba(0,0,0,0.02);
}

.table tbody tr:nth-child(even):hover {
    background: linear-gradient(90deg, rgba(196, 30, 58, 0.05), rgba(0,0,0,0.02));
}

/* Ranking Medals with Modern Design */
.table .rank-1 {
    background: linear-gradient(135deg, #FFD700 0%, #FFA500 100%) !important;
    font-weight: 700;
    color: #333;
    box-shadow: 0 4px 15px rgba(255, 215, 0, 0.4);
}

.table .rank-1 td:first-child::before {
    content: '🥇 ';
}

.table .rank-2 {
    background: linear-gradient(135deg, #E8E8E8 0%, #C0C0C0 100%) !important;
    font-weight: 700;
    color: #333;
    box-shadow: 0 4px 15px rgba(192, 192, 192, 0.4);
}

.table .rank-2 td:first-child::before {
    content: '🥈 ';
}

.table .rank-3 {
    background: linear-gradient(135deg, #CD7F32 0%, #8B4513 100%) !important;
    font-weight: 700;
    color: var(--urjc-white);
    box-shadow: 0 4px 15px rgba(205, 127, 50, 0.4);
}

.table .rank-3 td:first-child::before {
    content: '🥉 ';
}

/* Ranking position badges */
.table td:first-child {
    font-weight: 700;
    font-size: 1.1rem;
}

/* Modern table container with scroll */
#ranking-table-container {
    position: relative;
    border-radius: var(--border-radius);
    overflow: hidden;
}

#ranking-table-container::-webkit-scrollbar {
    height: 8px;
}

#ranking-table-container::-webkit-scrollbar-track {
    background: var(--urjc-light-gray);
    border-radius: 4px;
}

#ranking-table-container::-webkit-scrollbar-thumb {
    background: var(--urjc-red);
    border-radius: 4px;
}

#ranking-table-container::-webkit-scrollbar-thumb:hover {
    background: var(--urjc-dark-red);
}

/* Alerts - Modern Design */
.alert {
    padding: 1.25rem 1.5rem;
    margin-bottom: 1.5rem;
    border: none;
    border-radius: var(--border-radius);
    border-left: 4px solid;
    box-shadow: var(--shadow-sm);
    animation: slideInDown 0.4s ease-out;
}

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

.alert-success {
    color: #155724;
    background: linear-gradient(135deg, #D4EDDA 0%, #C3E6CB 100%);
    border-left-color: #28A745;
}

.alert-danger {
    color: #721C24;
    background: linear-gradient(135deg, #F8D7DA 0%, #F5C6CB 100%);
    border-left-color: #DC3545;
}

.alert-warning {
    color: #856404;
    background: linear-gradient(135deg, #FFF3CD 0%, #FFEAA7 100%);
    border-left-color: #FFC107;
}

.alert-info {
    color: #0C5460;
    background: linear-gradient(135deg, #D1ECF1 0%, #BEE5EB 100%);
    border-left-color: #17A2B8;
}

/* Login Form */
.login-container {
    min-height: calc(100vh - 200px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem 0;
}

.login-card {
    width: 100%;
    max-width: 440px;
    background: var(--urjc-white);
    padding: 3rem;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-lg);
    animation: scaleIn 0.5s ease-out;
    border-top: 4px solid var(--urjc-red);
}

@keyframes scaleIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

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

.login-header h2 {
    color: var(--urjc-red);
    margin-bottom: 0.75rem;
    font-size: 2rem;
    font-weight: 700;
}

/* Grid Layout */
.grid {
    display: grid;
    gap: 2rem;
}

.grid-2 {
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
}

.grid-3 {
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
}

/* Utilities */
.text-center {
    text-align: center;
}

.text-right {
    text-align: right;
}

.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }

.hidden {
    display: none !important;
}

/* Modal Styles */
#password-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
}

#password-modal.hidden {
    display: none !important;
}

#password-modal .login-container {
    min-height: auto;
}

.loading {
    opacity: 0.6;
    pointer-events: none;
}

/* Responsive Design */
@media (max-width: 768px) {
    .header-content {
        flex-direction: column;
        gap: 1rem;
    }
    
    .nav {
        flex-wrap: wrap;
        justify-content: center;
    }
    
    .container {
        padding: 0 1rem;
    }
    
    .card {
        padding: 1rem;
    }
    
    .table {
        font-size: 0.9rem;
    }
    
    .table th,
    .table td {
        padding: 0.5rem;
    }
}

/* Status Indicators */
.status-indicator {
    display: inline-block;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    margin-right: 0.5rem;
    animation: pulse 2s infinite;
    box-shadow: 0 0 10px currentColor;
}

.status-online {
    background-color: #28A745;
}

.status-frozen {
    background-color: #FFC107;
}

.status-offline {
    background-color: #DC3545;
}

/* Countdown timer styles */
.countdown-timer {
    font-size: 1.4em;
    color: var(--urjc-red);
    margin: 1rem 0;
    font-weight: 700;
    text-shadow: 0 2px 4px rgba(0,0,0,0.1);
    letter-spacing: 0.5px;
}

.end-date-info {
    font-size: 0.95em;
    color: var(--urjc-text-light);
    font-style: italic;
    margin-top: 0.5rem;
}

.competition-info {
    background: linear-gradient(135deg, rgba(196, 30, 58, 0.05) 0%, rgba(196, 30, 58, 0.02) 100%);
    padding: 2rem;
    border-radius: var(--border-radius);
    border: 2px solid rgba(196, 30, 58, 0.2);
    margin-bottom: 2rem;
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
}

.competition-info:hover {
    border-color: var(--urjc-red);
    box-shadow: var(--shadow-md);
}

/* User management styles */
.badge {
    display: inline-block;
    padding: 0.35em 0.75em;
    font-size: 0.8em;
    font-weight: 600;
    line-height: 1;
    text-align: center;
    white-space: nowrap;
    vertical-align: baseline;
    border-radius: 6px;
    box-shadow: var(--shadow-sm);
}

.badge-success {
    color: #fff;
    background: linear-gradient(135deg, #28a745, #218838);
}

.badge-secondary {
    color: #fff;
    background: linear-gradient(135deg, #6c757d, #5a6268);
}

.btn-group {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

/* Footer - Modern Design with Social Links */
.footer {
    background: linear-gradient(135deg, #0f0f0f 0%, var(--urjc-black) 100%);
    color: var(--urjc-white);
    text-align: center;
    padding: 3rem 0;
    margin-top: 4rem;
    position: relative;
    overflow: hidden;
}

.footer::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 3px;
    background: linear-gradient(90deg, transparent, var(--urjc-red), transparent);
}

.footer-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
}

.footer-content p {
    margin: 0.5rem 0;
    opacity: 0.9;
    font-size: 0.95rem;
}

.footer-content strong {
    color: var(--urjc-red);
    font-weight: 600;
}

.footer-links {
    display: flex;
    gap: 1.5rem;
    justify-content: center;
    align-items: center;
    margin-top: 1.5rem;
}

.footer-links a {
    color: var(--urjc-white);
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    position: relative;
    overflow: hidden;
}

.footer-links a::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--urjc-red);
    transform: scale(0);
    transition: transform 0.3s ease;
    border-radius: 50%;
}

.footer-links a:hover::before {
    transform: scale(1);
}

.footer-links a svg {
    position: relative;
    z-index: 1;
    transition: var(--transition);
}

.footer-links a:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 20px rgba(196, 30, 58, 0.4);
}

.footer-links a:hover svg {
    transform: scale(1.1);
}

/* Small inline author icons next to the author name */
.author-links {
    display: inline-flex;
    gap: 8px;
    margin-left: 8px;
    vertical-align: middle;
}

.author-links a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.12);
    color: var(--urjc-white);
    transition: var(--transition);
}

.author-links a svg {
    width: 14px;
    height: 14px;
}

.author-links a:hover {
    transform: translateY(-2px);
}

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

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

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

/* Enhanced button styles with icons */
.btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(0,0,0,0.2) !important;
}

.btn:active {
    transform: translateY(-1px);
    box-shadow: 0 3px 10px rgba(0,0,0,0.15) !important;
}

/* Competition buttons container - Force horizontal layout */
#competition-buttons,
#ranking-buttons {
    display: flex !important;
    flex-direction: row !important;
    justify-content: center !important;
    align-items: center !important;
    gap: 20px !important;
    flex-wrap: nowrap !important;
    width: 100% !important;
    margin: 1.5rem 0 !important;
}

#competition-buttons .btn,
#ranking-buttons .btn {
    min-width: 180px;
    border: none;
    position: relative;
    overflow: hidden;
    display: inline-flex !important;
    flex-direction: row !important;
    align-items: center !important;
    white-space: nowrap !important;
    gap: 10px;
    padding: 1rem 1.75rem;
    border-radius: var(--border-radius);
    font-weight: 600;
    box-shadow: var(--shadow-md);
    transition: var(--transition);
}

.btn-icon {
    font-size: 18px;
    display: inline-block;
}

/* Responsive design for buttons */
@media (max-width: 768px) {
    #competition-buttons,
    #ranking-buttons {
        gap: 12px !important;
        flex-wrap: wrap;
    }

    #competition-buttons .btn,
    #ranking-buttons .btn {
        flex: 1;
        min-width: 150px;
        max-width: 220px;
        justify-content: center;
    }
}

@media (max-width: 480px) {
    #competition-buttons,
    #ranking-buttons {
        flex-direction: column !important;
        align-items: center;
    }

    #competition-buttons .btn,
    #ranking-buttons .btn {
        width: 100%;
        max-width: 280px;
    }
}

/* Additional Modern Enhancements */

/* Improved code blocks */
code {
    background: rgba(196, 30, 58, 0.1);
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    font-family: 'Courier New', monospace;
    font-size: 0.9em;
    color: var(--urjc-dark-red);
}

/* Links styling */
a {
    color: var(--urjc-red);
    transition: var(--transition);
}

a:hover {
    color: var(--urjc-dark-red);
}

/* Improved lists */
ol, ul {
    line-height: 1.8;
}

ol li, ul li {
    margin-bottom: 0.5rem;
}

/* Enhanced hr */
hr {
    border: none;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--urjc-red), transparent);
    margin: 2rem 0;
}

/* Loading states */
.loading {
    opacity: 0.6;
    pointer-events: none;
    position: relative;
}

.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 30px;
    height: 30px;
    margin: -15px 0 0 -15px;
    border: 3px solid var(--urjc-light-gray);
    border-top-color: var(--urjc-red);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* Tooltips */
[title] {
    position: relative;
    cursor: help;
}

/* Enhanced mobile menu */
@media (max-width: 768px) {
    .container {
        padding: 0 1rem;
    }
    
    .card {
        padding: 1.5rem;
    }
    
    .table {
        font-size: 0.9rem;
    }
    
    .table th,
    .table td {
        padding: 0.75rem 0.5rem;
    }
    
    h2 {
        font-size: 1.5rem;
    }
    
    h3 {
        font-size: 1.25rem;
    }
}

/* Skeleton loading animation */
@keyframes shimmer {
    0% {
        background-position: -1000px 0;
    }
    100% {
        background-position: 1000px 0;
    }
}

.skeleton {
    background: linear-gradient(90deg, var(--urjc-light-gray) 25%, #f0f0f0 50%, var(--urjc-light-gray) 75%);
    background-size: 1000px 100%;
    animation: shimmer 2s infinite;
}

/* Improved focus states for accessibility */
button:focus,
a:focus,
input:focus,
textarea:focus,
select:focus {
    outline: 2px solid var(--urjc-red);
    outline-offset: 2px;
}

/* Print styles */
@media print {
    .header,
    .footer,
    .nav,
    .btn {
        display: none;
    }
    
    .card {
        box-shadow: none;
        border: 1px solid #ddd;
        page-break-inside: avoid;
    }
}

/* Text utilities */
.text-muted {
    color: var(--urjc-text-light);
}

small {
    font-size: 0.875rem;
    color: var(--urjc-text-light);
}

strong {
    font-weight: 600;
}

/* Selection color */
::selection {
    background: var(--urjc-red);
    color: var(--urjc-white);
}

::-moz-selection {
    background: var(--urjc-red);
    color: var(--urjc-white);
}

/* Toast Notifications */
.toast-container {
    position: fixed;
    top: 100px;
    right: 20px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    pointer-events: none;
}

.toast {
    background: var(--urjc-white);
    border-radius: var(--border-radius);
    box-shadow: 0 8px 32px rgba(0,0,0,0.3);
    padding: 1.25rem 1.5rem;
    min-width: 320px;
    max-width: 420px;
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    pointer-events: auto;
    animation: slideInRight 0.4s ease-out;
    border-left: 4px solid;
    position: relative;
    overflow: hidden;
    opacity: 1;
}

.toast.toast-success {
    border-left-color: #28A745;
    background: linear-gradient(135deg, rgba(40, 167, 69, 0.95) 0%, rgba(255, 255, 255, 0.98) 100%);
}

.toast.toast-error {
    border-left-color: #DC3545;
    background: linear-gradient(135deg, rgba(220, 53, 69, 0.95) 0%, rgba(255, 255, 255, 0.98) 100%);
}

.toast.toast-warning {
    border-left-color: #FFC107;
    background: linear-gradient(135deg, rgba(255, 193, 7, 0.95) 0%, rgba(255, 255, 255, 0.98) 100%);
}

.toast.toast-info {
    border-left-color: #17A2B8;
    background: linear-gradient(135deg, rgba(23, 162, 184, 0.95) 0%, rgba(255, 255, 255, 0.98) 100%);
}

.toast-icon {
    flex-shrink: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    border-radius: 50%;
}

.toast.toast-success .toast-icon {
    background: #28A745;
    color: white;
}

.toast.toast-error .toast-icon {
    background: #DC3545;
    color: white;
}

.toast.toast-warning .toast-icon {
    background: #FFC107;
    color: #333;
}

.toast.toast-info .toast-icon {
    background: #17A2B8;
    color: white;
}

.toast-content {
    flex: 1;
}

.toast-title {
    font-weight: 600;
    font-size: 1rem;
    margin-bottom: 0.25rem;
    color: var(--urjc-text-dark);
}

.toast-message {
    font-size: 0.9rem;
    color: var(--urjc-text-dark);
    line-height: 1.5;
}

.toast-close {
    flex-shrink: 0;
    background: none;
    border: none;
    color: var(--urjc-text-light);
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: var(--transition);
}

.toast-close:hover {
    background: rgba(0,0,0,0.1);
    color: var(--urjc-text-dark);
}

.toast-progress {
    position: absolute;
    bottom: 0;
    left: 0;
    height: 3px;
    background: currentColor;
    opacity: 0.3;
    animation: toastProgress 5s linear forwards;
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(100%);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes slideOutRight {
    from {
        opacity: 1;
        transform: translateX(0);
    }
    to {
        opacity: 0;
        transform: translateX(100%);
    }
}

@keyframes toastProgress {
    from {
        width: 100%;
    }
    to {
        width: 0%;
    }
}

.toast.toast-exit {
    animation: slideOutRight 0.3s ease-out forwards;
}

@media (max-width: 768px) {
    .toast-container {
        top: 80px;
        right: 10px;
        left: 10px;
    }
    
    .toast {
        min-width: auto;
        max-width: none;
    }
}
