/* Custom CSS for KOI Olympic Committee Dashboard */

/* Sidebar Styles */
.main-sidebar {
    position: fixed;
    left: 0;
    top: 0;
    height: 100vh;
    width: 256px;
    z-index: 1000;
    overflow-y: auto;
    background-color: #ffffff !important;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), width 0.3s ease;
}

.sidebar-menu {
    list-style: none;
    padding: 0;
    margin: 0;
}

.sidebar-menu li {
    margin: 0;
    position: relative;
}

.sidebar-menu .menu-header {
    padding: 10px 20px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    color: rgba(107, 114, 128, 0.8);
    letter-spacing: 1px;
}

.sidebar-menu .nav-link {
    display: flex;
    align-items: center;
    padding: 12px 20px;
    color: #6B7280;
    text-decoration: none;
    transition: all 0.3s ease;
    border-radius: 0;
    margin: 2px 8px;
    position: relative;
}

.sidebar-menu .nav-link:hover {
    background-color: #F3F4F6;
    color: #374151;
}

.sidebar-menu .nav-link i {
    width: 20px;
    margin-right: 12px;
    text-align: center;
    font-size: 16px;
}

/* Active State - Red background with white border like dashboard label */
.sidebar-menu li.active .nav-link {
    background-color: #C40000;
    color: #ffffff;
    font-weight: 600;
    border-radius: 6px;
    border: 2px solid #ffffff;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* Remove the left indicator since we now have the full background */
.sidebar-menu li.active .nav-link::before {
    display: none;
}

.sidebar-menu li.menu-item.active .nav-link {
    background-color: #C40000;
    color: #ffffff;
    border: 2px solid #ffffff;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* Main Content Area */
.main-content {
    margin-left: 256px;
    transition: margin-left 0.3s ease;
}

/* Mobile Responsive Styles */
@media (max-width: 1024px) {
    .main-sidebar {
        position: fixed !important;
        top: 0 !important;
        left: 0 !important;
        height: 100vh !important;
        width: 256px !important;
        transform: translateX(-100%) !important;
        transition: transform 0.3s ease-in-out !important;
        z-index: 50 !important;
        background: #ffffff !important;
    }
    
    .main-sidebar.show {
        transform: translateX(0) !important;
    }
    
    .main-content {
        margin-left: 0;
    }
    
    /* Mobile header adjustments */
    .sidebar-menu .nav-link {
        padding: 16px 20px;
        font-size: 16px;
    }
    
    .sidebar-menu .nav-link i {
        font-size: 18px;
        width: 24px;
        margin-right: 16px;
    }
}

@media (max-width: 768px) {
    /* Smaller mobile devices */
    .main-sidebar {
        width: 280px;
    }
    
.sidebar-brand {
    padding: 20px 20px 24px 20px;
    text-align: center;
}

.sidebar-brand .logo-img {
    height: 30px !important;
    width: auto !important;
    object-fit: contain;
    max-width: 100%;
    display: block;
    transition: all 0.3s ease;
    transform: scale(0.8);
}
    
    .sidebar-menu .nav-link {
        padding: 18px 20px;
    }
}

/* Overlay styles */
#sidebar-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 45;
    opacity: 0;
    transition: opacity 0.3s ease-in-out;
}

#sidebar-overlay.show {
    display: block;
    opacity: 1;
}

/* Animation for smooth transitions */
.main-sidebar {
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Sidebar closing animation */
.main-sidebar.closing {
    transform: translateX(-100%);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Logo visibility fix for mobile */
.sidebar-brand .logo-img {
    display: block !important;
    visibility: visible !important;
}

/* Sidebar footer colors for red theme */
.sidebar-footer {
    border-top: 1px solid rgba(0, 0, 0, 0.1);
}

/* Additional styling for active menu to match dashboard label */
.sidebar-menu li.active .nav-link {
    margin: 4px 8px !important;
    padding: 10px 16px !important;
    font-size: 14px;
    font-weight: 700;
    text-transform: none;
}

/* Ensure inactive menu items remain gray */
.sidebar-menu li:not(.active) .nav-link {
    color: #6B7280;
    background-color: transparent;
    border: none;
    box-shadow: none;
}

/* Hover effect for inactive items */
.sidebar-menu li:not(.active) .nav-link:hover {
    background-color: #F9FAFB;
    color: #374151;
}

/* ===== CONSISTENT RED THEME (#C40000) ===== */

/* Primary buttons - Create Event, Manage, etc - Only for specific elements */
.btn-primary,
.btn-calendar,
button.bg-red-500,
.sidebar-menu li.active .nav-link {
    background-color: #C40000 !important;
    border-color: #C40000 !important;
}

.btn-primary:hover,
.btn-calendar:hover,
button.bg-red-500:hover,
button.hover\:bg-red-600:hover {
    background-color: #A30000 !important;
    border-color: #A30000 !important;
}

/* Only red labels that should stay red */
.bg-red-100 {
    background-color: rgba(196, 64, 0, 0.1) !important;
}

/* Only specific red text elements */
.text-red-500.sidebar-text,
.text-red-600.sidebar-text {
    color: #C40000 !important;
}

/* Focus states for inputs */
.focus\:ring-red-500:focus {
    --tw-ring-color: rgba(196, 64, 0, 0.5) !important;
}

/* Notification badges - keep red */
.bg-red-500.text-white {
    background-color: #C40000 !important;
}

/* Admin badge in header - keep red */
span.bg-red-500 {
    background-color: #C40000 !important;
}

/* User avatar background - keep red */
.bg-red-500.rounded-full {
    background-color: #C40000 !important;
}

/* High Priority labels should stay red */
span.bg-red-500:contains("High Priority"),
span.bg-red-600:contains("High Priority") {
    background-color: #C40000 !important;
}

/* Ensure sidebar is always visible on desktop */
@media (min-width: 1024px) {
    .main-sidebar {
        transform: translateX(0) !important;
        position: fixed;
    }
    
    #sidebar-overlay {
        display: none !important;
    }
}

/* ===== MODAL STYLES ===== */

#confirm-modal .bg-white {
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    border: 1px solid #e5e7eb;
}

/* Removed extreme backdrop animation for subtle effect */

/* CSS for modal card - cleaned up */

/* Enhanced Loading Overlay */
#loading-overlay {
    background: rgba(0, 0, 0, 0.4);
}

#loading-overlay .bg-white {
    box-shadow: 
        0 20px 25px -5px rgba(0, 0, 0, 0.3),
        0 0 0 1px rgba(229, 231, 235, 0.5);
}

/* Enhanced Button Effects */
#confirm-yes {
    position: relative;
    overflow: hidden;
}

#confirm-yes::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;
}

#confirm-yes:hover::before {
    left: 100%;
}

#confirm-yes:hover {
    transform: translateY(-2px);
    box-shadow: 
        0 10px 25px rgba(220, 38, 38, 0.4),
        0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

#confirm-cancel:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

/* Table row removal animation */
tbody tr {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Modal focus management */
#confirm-modal:focus-within {
    outline: none;
}

/* Responsive modal adjustments */
@media (max-width: 640px) {
    #confirm-modal .bg-white {
        margin: 1rem;
        max-width: calc(100vw - 2rem);
    }
}

/* Flash Message Animations */
.flash-message {
    opacity: 0;
    transform: translateX(100%);
    transition: all 0.3s ease-out;
}

.flash-message.show {
    opacity: 1;
    transform: translateX(0);
}

.flash-message.removing {
    opacity: 0;
    transform: translateX(100%);
}

/* Flash Container Styles */
#flash-container {
    pointer-events: none;
}

#flash-container .flash-message {
    pointer-events: auto;
}

