/* Custom styles for Over-Under Contests */

/* Global styles */
body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #f8f9fa;
}

/* Navigation */
.navbar-brand {
    font-weight: bold;
}

/* Hero section */
.jumbotron {
    background: linear-gradient(135deg, #007bff 0%, #0056b3 100%);
    border: none;
}

/* Cards */
.card {
    border: none;
    box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
    transition: box-shadow 0.15s ease-in-out;
}

.card:hover {
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
}

.card-header {
    background-color: #f8f9fa;
    border-bottom: 1px solid #dee2e6;
    font-weight: 600;
}

/* Buttons */
.btn {
    border-radius: 0.375rem;
    font-weight: 500;
}

.btn-primary {
    background-color: #007bff;
    border-color: #007bff;
}

.btn-primary:hover {
    background-color: #0056b3;
    border-color: #0056b3;
}

/* Forms */
.form-control {
    border-radius: 0.375rem;
    border: 1px solid #ced4da;
}

.form-control:focus {
    border-color: #007bff;
    box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25);
}

/* Badges */
.badge {
    font-size: 0.75em;
    font-weight: 500;
}

/* Contest cards */
.contest-card {
    transition: transform 0.2s ease-in-out;
}

.contest-card:hover {
    transform: translateY(-2px);
}

/* Question forms */
.question-form {
    border: 1px solid #dee2e6;
    border-radius: 0.375rem;
    padding: 1rem;
    margin-bottom: 1rem;
    background-color: #fff;
}

.question-form:hover {
    border-color: #007bff;
}

/* Leaderboard */
.leaderboard-table {
    background-color: #fff;
    border-radius: 0.375rem;
    overflow: hidden;
}

.leaderboard-rank {
    font-weight: bold;
    font-size: 1.1em;
}

.leaderboard-rank.rank-1 {
    color: #ffd700;
}

.leaderboard-rank.rank-2 {
    color: #c0c0c0;
}

.leaderboard-rank.rank-3 {
    color: #cd7f32;
}

/* Admin panel */
.admin-sidebar {
    background-color: #343a40;
    min-height: calc(100vh - 56px);
}

.admin-sidebar .nav-link {
    color: #adb5bd;
}

.admin-sidebar .nav-link:hover {
    color: #fff;
}

.admin-sidebar .nav-link.active {
    color: #fff;
    background-color: #495057;
}

/* Statistics cards */
.stat-card {
    background: linear-gradient(135deg, #007bff 0%, #0056b3 100%);
    color: white;
    border: none;
}

.stat-card .card-body {
    padding: 1.5rem;
}

.stat-number {
    font-size: 2rem;
    font-weight: bold;
}

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

.spinner-border-sm {
    width: 1rem;
    height: 1rem;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .jumbotron {
        padding: 2rem 1rem;
    }
    
    .jumbotron h1 {
        font-size: 2rem;
    }
    
    .card-body {
        padding: 1rem;
    }
    
    .btn-lg {
        padding: 0.5rem 1rem;
        font-size: 1rem;
    }
}

/* Contest entry form */
.question-card {
    border-left: 4px solid #007bff;
}

.answer-options {
    display: flex;
    gap: 1rem;
    justify-content: center;
    margin-top: 1rem;
}

.answer-option {
    flex: 1;
    max-width: 150px;
}

.answer-option input[type="radio"] {
    display: none;
}

.answer-option label {
    display: block;
    padding: 0.75rem 1rem;
    border: 2px solid #dee2e6;
    border-radius: 0.375rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s ease-in-out;
    background-color: #fff;
}

.answer-option input[type="radio"]:checked + label {
    border-color: #007bff;
    background-color: #007bff;
    color: #fff;
}

.answer-option label:hover {
    border-color: #007bff;
}

/* Progress indicators */
.progress-container {
    margin-bottom: 2rem;
}

.progress {
    height: 0.5rem;
    border-radius: 0.25rem;
}

/* Alert customizations */
.alert {
    border: none;
    border-radius: 0.375rem;
}

.alert-success {
    background-color: #d1edff;
    color: #0c5460;
}

.alert-danger {
    background-color: #f8d7da;
    color: #721c24;
}

.alert-warning {
    background-color: #fff3cd;
    color: #856404;
}

.alert-info {
    background-color: #d1ecf1;
    color: #0c5460;
}

/* Footer */
footer {
    margin-top: auto;
}

/* Utility classes */
.text-truncate-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.shadow-sm-hover:hover {
    box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075) !important;
}

/* Countdown Timer Styles */
.countdown-timer {
    font-weight: bold;
    padding: 0.25rem 0.5rem;
    border-radius: 0.25rem;
    display: inline-block;
    transition: all 0.3s ease;
}

.countdown-normal {
    background-color: #e3f2fd;
    color: #1976d2;
    border: 1px solid #bbdefb;
}

.countdown-urgent {
    background-color: #fff3e0;
    color: #f57c00;
    border: 1px solid #ffcc02;
    animation: pulse-urgent 2s infinite;
}

.countdown-critical {
    background-color: #ffebee;
    color: #d32f2f;
    border: 1px solid #ffcdd2;
    animation: pulse-critical 1s infinite;
}

.countdown-expired {
    background-color: #f3e5f5;
    color: #7b1fa2;
    border: 1px solid #e1bee7;
}

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

@keyframes pulse-critical {
    0%, 100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(211, 47, 47, 0.7); }
    50% { transform: scale(1.1); box-shadow: 0 0 0 10px rgba(211, 47, 47, 0); }
}

/* Auto-save indicator */
.autosave-indicator {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 1050;
    padding: 0.5rem 1rem;
    border-radius: 0.375rem;
    font-size: 0.875rem;
    font-weight: 500;
    transition: all 0.3s ease;
    opacity: 0;
    transform: translateY(-20px);
}

.autosave-indicator.show {
    opacity: 1;
    transform: translateY(0);
}

.autosave-indicator.saving {
    background-color: #fff3cd;
    color: #856404;
    border: 1px solid #ffeaa7;
}

.autosave-indicator.saved {
    background-color: #d1edff;
    color: #0c5460;
    border: 1px solid #bee5eb;
}

.autosave-indicator.error {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

/* Enhanced mobile styles */
@media (max-width: 768px) {
    .jumbotron {
        padding: 1.5rem 1rem;
    }
    
    .jumbotron h1 {
        font-size: 1.75rem;
    }
    
    .card-body {
        padding: 0.75rem;
    }
    
    .btn-lg {
        padding: 0.5rem 1rem;
        font-size: 1rem;
    }
    
    /* Mobile-optimized contest cards */
    .contest-card {
        margin-bottom: 1rem;
    }
    
    .contest-card .card-body {
        padding: 1rem;
    }
    
    .contest-card .btn {
        width: 100%;
        margin-bottom: 0.5rem;
    }
    
    /* Mobile-friendly question forms */
    .question-card {
        margin-bottom: 1rem;
    }
    
    .answer-options {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .answer-option {
        max-width: none;
    }
    
    .answer-option label {
        padding: 1rem;
        font-size: 1.1rem;
    }
    
    /* Mobile navigation improvements */
    .navbar-nav .nav-link {
        padding: 0.75rem 1rem;
    }
    
    .dropdown-menu {
        border: none;
        box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
    }
    
    /* Mobile-friendly tables */
    .table-responsive {
        border: none;
    }
    
    .table-responsive .table {
        margin-bottom: 0;
    }
    
    /* Mobile countdown timers */
    .countdown-timer {
        font-size: 0.9rem;
        padding: 0.375rem 0.75rem;
    }
    
    /* Mobile autosave indicator */
    .autosave-indicator {
        top: 10px;
        right: 10px;
        left: 10px;
        text-align: center;
    }
}

/* Touch-friendly improvements */
@media (hover: none) and (pointer: coarse) {
    .btn {
        min-height: 44px;
        padding: 0.75rem 1rem;
    }
    
    .form-control {
        min-height: 44px;
        font-size: 16px; /* Prevents zoom on iOS */
    }
    
    .answer-option label {
        min-height: 44px;
        display: flex;
        align-items: center;
        justify-content: center;
    }
    
    .card:hover {
        transform: none; /* Disable hover effects on touch devices */
        box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
    }
}

/* Loading states */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.loading-overlay.show {
    opacity: 1;
    visibility: visible;
}

.loading-spinner {
    background-color: white;
    padding: 2rem;
    border-radius: 0.5rem;
    text-align: center;
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
}

/* Search and filter styles */
.search-filter-container {
    background-color: #f8f9fa;
    border-radius: 0.375rem;
    padding: 1rem;
    margin-bottom: 1.5rem;
    border: 1px solid #dee2e6;
}

.search-input {
    border-radius: 0.375rem;
    border: 1px solid #ced4da;
    transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
}

.search-input:focus {
    border-color: #007bff;
    box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25);
}

.filter-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 0.5rem;
}

.filter-tag {
    background-color: #007bff;
    color: white;
    padding: 0.25rem 0.5rem;
    border-radius: 1rem;
    font-size: 0.875rem;
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.filter-tag .remove {
    cursor: pointer;
    font-weight: bold;
}

.filter-tag .remove:hover {
    color: #ffcccc;
}

/* Animation classes */
.fade-in {
    animation: fadeIn 0.5s ease-in;
}

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

.slide-in {
    animation: slideIn 0.3s ease-out;
}

@keyframes slideIn {
    from { transform: translateX(-100%); }
    to { transform: translateX(0); }
}

/* Notification styles */
.notification-toast {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 1055;
    min-width: 300px;
    max-width: 400px;
    background-color: white;
    border-radius: 0.375rem;
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
    border: 1px solid #dee2e6;
    opacity: 0;
    transform: translateX(100%);
    transition: all 0.3s ease;
}

.notification-toast.show {
    opacity: 1;
    transform: translateX(0);
}

.notification-toast .toast-header {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid #dee2e6;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.notification-toast .toast-body {
    padding: 1rem;
}

.notification-toast.success .toast-header {
    background-color: #d1edff;
    color: #0c5460;
}

.notification-toast.warning .toast-header {
    background-color: #fff3cd;
    color: #856404;
}

.notification-toast.error .toast-header {
    background-color: #f8d7da;
    color: #721c24;
}
