/* CSS Variables */
:root {
    /* Colors */
    --primary-color: #4a90e2;
    --secondary-color: #2c3e50;
    --accent-color: #e74c3c;
    --text-color: #2c3e50;
    
    /* Gradients */
    --gradient-start: #4a90e2;
    --gradient-end: #357abd;
    --button-gradient-start: #ff4757;
    --button-gradient-end: #ff6b81;
    
    /* UI Elements */
    --card-bg: rgba(255, 255, 255, 0.95);
    --navbar-bg: rgba(255, 255, 255, 0.95);
    --shadow-color: rgba(0, 0, 0, 0.1);
}

/* Base styles for layout and common elements */
html, body {
    height: 100%;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Poppins', sans-serif;
    color: var(--text-color);
    background: linear-gradient(135deg, var(--gradient-start) 0%, var(--gradient-end) 100%) !important;
    background-attachment: fixed !important;
    min-height: 100vh;
    position: relative;
}

main {
    min-height: calc(100vh - 60px);
    padding: 20px 0;
    background: transparent;
}

/* Attempts badge styles */
.attempts-badge {
    padding: 2px 6px;
    border-radius: 4px;
    font-weight: 500;
    background-color: #f0f9ff;
    color: #0d6efd;
}

/* First attempt */
.attempts-badge:has(:nth-child(1)) {
    background-color: #dcfce7;
    color: #16a34a;
}

/* Second attempt */
.attempts-badge:has(:nth-child(2)) {
    background-color: #fff3cd;
    color: #d97706;
}

/* Third attempt and above */
.attempts-badge:has(:nth-child(n+3)) {
    background-color: #fee2e2;
    color: #dc2626;
}

/* Organization badge styles */
.organization-badge {
    display: inline-block;
    padding: 0.25em 0.5em;
    margin-left: 0.5rem;
    font-size: 0.75rem;
    font-weight: 500;
    line-height: 1;
    color: #212529;
    background-color: #f8f9fa;
    border-radius: 0.25rem;
    opacity: 0.9;
    vertical-align: middle;
}

/* Dark mode support */
[data-bs-theme="dark"] .organization-badge {
    color: #f8f9fa;
    background-color: #212529;
}

.brand-text {
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--text-color);
    margin-left: 0.5rem;
}

/* Custom Dropdown Styles */
.navbar {
    padding: 0.75rem 1rem;
    position: relative;
}

.navbar-collapse {
    overflow: visible !important;
}

/* Custom Dropdown */
.custom-dropdown {
    position: relative;
}

.custom-dropdown .dropdown-toggle {
    cursor: pointer;
    display: flex;
    align-items: center;
    padding: 0.5rem 1rem;
    color: rgba(0, 0, 0, 0.55);
    text-decoration: none;
    transition: color 0.15s ease-in-out;
    white-space: nowrap;
}

.custom-dropdown .dropdown-toggle:hover {
    color: rgba(0, 0, 0, 0.7);
    background-color: transparent;
}

.custom-dropdown .dropdown-arrow {
    font-size: 0.75rem;
    transition: transform 0.2s ease-in-out;
    margin-left: 0.25rem;
}

.custom-dropdown.active .dropdown-arrow {
    transform: rotate(180deg);
}

.custom-dropdown-menu {
    position: absolute;
    top: 100%;
    right: 0;
    z-index: 1000;
    display: none;
    min-width: 12rem;
    padding: 0.25rem 0;
    margin: 0.125rem 0 0;
    font-size: 0.875rem;
    color: #212529;
    text-align: left;
    list-style: none;
    background-color: #fff;
    background-clip: padding-box;
    border: 1px solid rgba(0, 0, 0, 0.15);
    border-radius: 0.375rem;
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.1);
}

.custom-dropdown-menu.show {
    display: block;
}

.custom-dropdown-menu .dropdown-item {
    display: flex;
    align-items: center;
    width: 100%;
    padding: 0.5rem 1rem;
    margin: 0;
    clear: both;
    font-weight: 400;
    color: #212529;
    text-align: left;
    text-decoration: none;
    white-space: nowrap;
    background-color: transparent;
    border: 0;
    transition: all 0.15s ease-in-out;
    line-height: 1.5;
    box-sizing: border-box;
}

.custom-dropdown-menu .dropdown-item i {
    width: 1.25rem;
    margin-right: 0.75rem;
    text-align: center;
    font-size: 0.9em;
    color: #6c757d;
    flex-shrink: 0;
}

.custom-dropdown-menu .dropdown-item:hover {
    background-color: #f8f9fa;
    color: #0d6efd;
    text-decoration: none;
}

.custom-dropdown-menu .dropdown-item:hover i {
    color: #0d6efd;
}

.custom-dropdown-menu .dropdown-divider {
    height: 0;
    margin: 0.25rem 0;
    overflow: hidden;
    border-top: 1px solid rgba(0, 0, 0, 0.1);
}

/* Mobile styles */
@media (max-width: 991.98px) {
    .navbar-collapse {
        padding: 1rem;
        background-color: var(--navbar-bg);
        border-radius: 0.5rem;
        margin-top: 0.5rem;
        box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.1);
        position: relative;
        z-index: 1000;
        max-height: none !important;
    }
    
    .custom-dropdown {
        width: 100%;
    }
    
    .custom-dropdown-menu {
        position: static;
        width: 100%;
        margin-top: 0.5rem;
        box-shadow: none;
        border: 1px solid rgba(0, 0, 0, 0.1);
    }
}

/* Ensure dropdown is visible on mobile */
@media (max-width: 991.98px) {
    .navbar-collapse {
        padding: 1rem;
        background-color: var(--navbar-bg);
        border-radius: 0.5rem;
        margin-top: 0.5rem;
        box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.1);
        position: relative;
        z-index: 1000;
        overflow: visible !important;
        max-height: none !important;
    }
    
    .navbar-nav {
        margin: 0 -1rem;
    }
    
    .nav-item {
        padding: 0 1rem;
    }
    
    .navbar-nav .dropdown-menu {
        position: static !important;
        float: none;
        margin: 0.5rem 0 0 1rem;
        border: 1px solid rgba(0, 0, 0, 0.1);
        box-shadow: none;
        background-color: rgba(255, 255, 255, 0.95);
        z-index: 1001;
        width: auto;
        min-width: 200px;
        display: none;
    }
    
    .navbar-nav .dropdown.show .dropdown-menu {
        display: block;
    }
    
    .dropdown-menu.show {
        display: block;
    }
    
    .navbar-nav .dropdown-toggle::after {
        float: right;
        margin-top: 0.5em;
    }
}

/* Desktop styles */
@media (min-width: 992px) {
    .navbar-nav .dropdown-menu {
        position: absolute !important;
        z-index: 1001;
        margin-top: 0.5rem;
        box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.1);
    }
    
    .dropdown-menu-end {
        right: 0;
        left: auto;
    }
    
    .navbar-nav .dropdown:hover .dropdown-menu {
        display: block;
        margin-top: 0;
    }
}

.navbar-brand {
    text-decoration: none;
}

.navbar-brand:hover .brand-text {
    color: #4a90e2;
}

.nav-link {
    color: var(--text-color);
    font-weight: 500;
    transition: all 0.3s ease;
    padding: 0.5rem 1rem;
}

.nav-link:hover {
    color: #4a90e2;
}

.navbar {
    padding: 0.5rem 0;
    background-color: #ffffff !important;
    flex-shrink: 0;
}

.navbar img {
    height: 35px;
}

.footer {
    padding: 1rem 0;
    font-size: 0.9rem;
    background-color: #ffffff !important;
    flex-shrink: 0;
}

/* Common container styles */
.container {
    padding: 0 1rem;
}

/* Common text styles */
.text-muted {
    color: #6c757d !important;
}

/* Common spacing utilities */
.mt-4 {
    margin-top: 1.5rem !important;
}

.mb-4 {
    margin-bottom: 1.5rem !important;
}

.mb-5 {
    margin-bottom: 3rem !important;
}

/* Common shadow utilities */
.shadow-sm {
    box-shadow: 0 .125rem .25rem rgba(0,0,0,.075) !important;
}

.shadow-lg {
    box-shadow: 0 .5rem 1rem rgba(0,0,0,.15) !important;
}

/* Animations */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
} 