/* RegardingWork Game - Custom Styles */

/* Color Variables */
:root {
    --primary-color: #007bff;
    --secondary-color: #6c757d;
    --success-color: #28a745;
    --warning-color: #ffc107;
    --danger-color: #dc3545;
    --info-color: #17a2b8;
    --light-color: #f8f9fa;
    --dark-color: #343a40;
    
    /* Custom Brand Colors */
    --brand-orange: #ff6b35;
    --brand-purple: #6f42c1;
    --brand-pink: #e83e8c;
    --brand-teal: #20c997;
    --brand-cyan: #0dcaf0;
    
    /* Gradient Colors */
    --gradient-primary: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --gradient-success: linear-gradient(135deg, #11998e 0%, #38ef7d 100%);
    --gradient-warning: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    --gradient-info: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
}

/* Body and Layout */
body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #f8f9fa;
    line-height: 1.6;
}

/* Custom Gradients */
.bg-gradient-primary {
    background: var(--gradient-primary) !important;
}

.bg-gradient-success {
    background: var(--gradient-success) !important;
}

.bg-gradient-warning {
    background: var(--gradient-warning) !important;
}

.bg-gradient-info {
    background: var(--gradient-info) !important;
}

/* Hero Section */
.hero-section {
    background: var(--gradient-primary);
    border-radius: 15px !important;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

/* Cards */
.card {
    border: none;
    border-radius: 15px;
    transition: all 0.3s ease;
    box-shadow: 0 2px 15px rgba(0, 0, 0, 0.08);
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

.card-header {
    border-radius: 15px 15px 0 0 !important;
    border-bottom: none;
    font-weight: 600;
}

/* Buttons */
.btn {
    border-radius: 25px;
    font-weight: 600;
    padding: 10px 20px;
    transition: all 0.3s ease;
    text-transform: none;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

.btn-lg {
    padding: 12px 30px;
    font-size: 1.1rem;
}

.btn-sm {
    padding: 6px 15px;
    font-size: 0.9rem;
}

/* Custom Button Colors */
.btn-primary {
    background: var(--gradient-primary);
    border: none;
}

.btn-success {
    background: var(--gradient-success);
    border: none;
}

.btn-warning {
    background: var(--gradient-warning);
    border: none;
    color: white;
}

.btn-info {
    background: var(--gradient-info);
    border: none;
}

/* Progress Bars */
.progress {
    height: 12px;
    border-radius: 25px;
    background-color: rgba(255, 255, 255, 0.3);
}

.progress-bar {
    border-radius: 25px;
    transition: width 0.6s ease;
}

/* Badges */
.badge {
    border-radius: 15px;
    font-weight: 500;
    padding: 6px 12px;
}

/* Navigation */
.navbar {
    padding: 1rem 0;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.navbar-brand {
    font-size: 1.5rem;
    font-weight: bold;
}

.navbar-nav .nav-link {
    font-weight: 500;
    margin: 0 5px;
    border-radius: 20px;
    transition: all 0.3s ease;
}

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

/* Profile Images */
.rounded-circle {
    object-fit: cover;
    border: 3px solid white;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

/* Alerts */
.alert {
    border: none;
    border-radius: 15px;
    font-weight: 500;
    box-shadow: 0 3px 15px rgba(0, 0, 0, 0.1);
}

/* Forms */
.form-control {
    border-radius: 10px;
    border: 2px solid #e9ecef;
    padding: 12px 15px;
    transition: all 0.3s ease;
}

.form-control:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25);
    transform: translateY(-1px);
}

.form-select {
    border-radius: 10px;
    border: 2px solid #e9ecef;
    padding: 12px 15px;
}

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

/* Tables and Lists */
.list-group-item {
    border: none;
    border-radius: 10px !important;
    margin-bottom: 5px;
    transition: all 0.3s ease;
}

.list-group-item:hover {
    background-color: var(--light-color);
    transform: translateX(5px);
}

/* Timer Specific Styles */
.timer-container {
    background: var(--gradient-primary);
    border-radius: 20px;
    padding: 2rem;
    color: white;
    text-align: center;
}

.timer-display {
    font-family: 'Courier New', monospace;
    font-size: 4rem;
    font-weight: bold;
    color: var(--warning-color);
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
}

/* Leaderboard Styles */
.leaderboard-rank {
    font-size: 2rem;
    font-weight: bold;
    width: 60px;
    text-align: center;
}

.leaderboard-item {
    transition: all 0.3s ease;
    border-radius: 15px;
}

.leaderboard-item:hover {
    background-color: var(--light-color) !important;
    transform: scale(1.02);
}

/* Stats Cards */
.stats-card {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 15px;
    color: white;
    transition: all 0.3s ease;
}

.stats-card:hover {
    transform: translateY(-5px);
}

/* Footer */
footer {
    margin-top: auto;
    background-color: var(--light-color);
    border-top: 1px solid #dee2e6;
}

/* Animations */
@keyframes bounce {
    0%, 20%, 50%, 80%, 100% {
        transform: translateY(0);
    }
    40% {
        transform: translateY(-10px);
    }
    60% {
        transform: translateY(-5px);
    }
}

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

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

.bounce-animation {
    animation: bounce 2s infinite;
}

.pulse-animation {
    animation: pulse 2s infinite;
}

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

/* Responsive Design */
@media (max-width: 768px) {
    .timer-display {
        font-size: 3rem;
    }
    
    .hero-section {
        padding: 2rem !important;
    }
    
    .hero-section h1 {
        font-size: 2rem !important;
    }
    
    .navbar-brand {
        font-size: 1.2rem;
    }
    
    .card-body {
        padding: 1rem;
    }
    
    .btn {
        padding: 8px 16px;
    }
    
    .btn-lg {
        padding: 10px 20px;
        font-size: 1rem;
    }
}

@media (max-width: 576px) {
    .timer-display {
        font-size: 2.5rem;
    }
    
    .container {
        padding: 0 10px;
    }
    
    .card {
        margin-bottom: 1rem;
    }
    
    .hero-section h1 {
        font-size: 1.8rem !important;
    }
    
    .hero-section .lead {
        font-size: 1rem;
    }
}

/* Dark Mode Support (Optional) */
@media (prefers-color-scheme: dark) {
    body {
        background-color: #1a1a1a;
        color: #ffffff;
    }
    
    .card {
        background-color: #2d2d2d;
        color: #ffffff;
    }
    
    .form-control {
        background-color: #3d3d3d;
        border-color: #555;
        color: #ffffff;
    }
    
    .navbar {
        background-color: #2d2d2d !important;
    }
}

/* Text Contrast Fixes */
.text-muted {
    color: #6c757d !important;
}

.form-text {
    color: #6c757d !important;
}

/* Fix white on light backgrounds */
.bg-light .text-muted {
    color: #495057 !important;
}

/* Ensure good contrast for project items */
.bg-light {
    background-color: #f8f9fa !important;
    color: #212529 !important;
}

.bg-light .text-primary {
    color: #0d6efd !important;
}

/* Dark text for light backgrounds */
.card-body .text-muted {
    color: #6c757d !important;
}

/* Ensure form labels are readable */
.form-label {
    color: #212529 !important;
    font-weight: 600;
}

/* Fix dropdown text */
.form-select {
    color: #212529 !important;
    background-color: #fff !important;
}

/* Privacy level explanation styling */
.privacy-explanation {
    background-color: #e3f2fd;
    border: 1px solid #2196f3;
    border-radius: 10px;
    padding: 12px;
    margin-top: 10px;
    color: #1976d2 !important;
}

.privacy-explanation .fas {
    color: #2196f3;
}

/* Project management text fixes */
.card-body p {
    color: #495057 !important;
}

.card-body h6 {
    color: #212529 !important;
}

/* Dashboard stat text improvements */
.stats-card .text-light {
    color: #ffffff !important;
}

/* Add Pomodoro Form Text Contrast Fixes */
.card-body .form-text {
    color: #6c757d !important;
    font-weight: 500;
}

.card-body .text-muted {
    color: #6c757d !important;
}

.card-body small.text-muted {
    color: #495057 !important;
}

/* Ensure form labels are dark enough */
.card-body .form-label {
    color: #212529 !important;
    font-weight: 600;
}

/* Category guide text improvements */
.card-body .mb-4 small.text-muted {
    color: #495057 !important;
}

.card-body .mb-4 small.text-muted strong {
    color: #212529 !important;
}

/* Settings page text improvements */
.card-body input::placeholder {
    color: #6c757d !important;
}

.card-body .form-control {
    color: #212529 !important;
    background-color: #ffffff !important;
}

/* Project management section fixes */
.card-body h6.fw-bold {
    color: #212529 !important;
}

.card-body .text-center p {
    color: #495057 !important;
}

/* Add pomodoro form text contrast fixes */
.card-body .form-label {
    color: #212529 !important;
    font-weight: 600;
}

.card-body .form-text {
    color: #6c757d !important;
}

/* Category guide text fixes */
.card-body .mb-4 {
    color: #495057 !important;
}

.card-body .mb-4 strong {
    color: #212529 !important;
}

/* Dark theme (default) */
body.dark-theme {
    background-color: #1a1a1a !important;
    color: #e9ecef !important;
}

body.dark-theme .card {
    background-color: #2d2d2d !important;
    color: #e9ecef !important;
    border: 1px solid #404040;
}

body.dark-theme .navbar {
    background-color: #343a40 !important;
}

body.dark-theme .text-muted {
    color: #adb5bd !important;
}

body.dark-theme .bg-light {
    background-color: #404040 !important;
    color: #e9ecef !important;
}

/* Team Dashboard Controls Panel - Light/Dark Mode Fix */
.controls-panel {
    background-color: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.controls-panel .filter-section {
    margin-bottom: 15px;
}

.controls-panel .form-label {
    color: #212529 !important;
    font-weight: 600;
    margin-bottom: 5px;
}

.controls-panel .form-select {
    color: #212529 !important;
    background-color: #ffffff !important;
    border: 1px solid #ced4da;
}

/* Dark mode for controls panel */
body.dark-theme .controls-panel {
    background-color: #2d2d2d !important;
    border: 1px solid #404040;
    color: #e9ecef !important;
}

body.dark-theme .controls-panel .form-label {
    color: #e9ecef !important;
}

body.dark-theme .controls-panel .form-select {
    color: #e9ecef !important;
    background-color: #404040 !important;
    border: 1px solid #555;
}

body.dark-theme .controls-panel .btn-outline-primary {
    color: #0dcaf0 !important;
    border-color: #0dcaf0;
}

body.dark-theme .controls-panel .btn-outline-primary:hover {
    background-color: #0dcaf0 !important;
    color: #000 !important;
}

/* Global Light/Dark Mode Text Visibility Fixes */
.form-label, .form-label strong {
    color: #212529 !important;
}

body.dark-theme .form-label, 
body.dark-theme .form-label strong {
    color: #e9ecef !important;
}

/* Ensure good contrast for all text elements */
body .text-dark {
    color: #212529 !important;
}

body.dark-theme .text-dark {
    color: #e9ecef !important;
}

/* Fix for small text and labels */
body small.text-muted {
    color: #6c757d !important;
}

body.dark-theme small.text-muted {
    color: #adb5bd !important;
}

/* Online Notification Bar - Force Visibility */
.online-notification-bar {
    background: linear-gradient(90deg, #667eea, #764ba2) !important;
    color: white !important;
}

.online-notification-bar * {
    color: white !important;
}

.online-notification-bar .opacity-75 {
    color: rgba(255,255,255,0.9) !important;
}

/* Ensure notification bar visibility in all themes */
body.dark-theme .online-notification-bar {
    background: linear-gradient(90deg, #4a5bcc, #5a3d87) !important;
    color: white !important;
}

body.dark-theme .online-notification-bar * {
    color: white !important;
}

/* Fix dropdown menu z-index to appear above notification bar */
.navbar .dropdown-menu {
    z-index: 1050 !important;
}

/* Ensure navbar itself has proper z-index */
.navbar {
    z-index: 1030 !important;
}

/* Fix sticky notification bar z-index to be below dropdowns */
.online-notification-bar {
    z-index: 1000 !important;
}

/* Light theme override */
body.light-theme {
    background-color: #f8f9fa !important;
    color: #212529 !important;
}

body.light-theme .card {
    background-color: #ffffff !important;
    color: #212529 !important;
    border: 1px solid #dee2e6;
}

body.light-theme .navbar {
    background-color: #007bff !important;
}

body.light-theme .text-muted {
    color: #6c757d !important;
}

body.light-theme .bg-dark {
    background-color: #ffffff !important;
    color: #212529 !important;
}

body.light-theme .text-white {
    color: #212529 !important;
}

/* Custom Emoji Enhancements */
.emoji-large {
    font-size: 2rem;
    line-height: 1;
}

.emoji-xl {
    font-size: 3rem;
    line-height: 1;
}

/* Streak Fire Effect */
.streak-fire {
    display: inline-block;
    animation: flicker 1.5s ease-in-out infinite alternate;
}

@keyframes flicker {
    0% {
        text-shadow: 0 0 5px #ff6b35, 0 0 10px #ff6b35, 0 0 15px #ff6b35;
    }
    100% {
        text-shadow: 0 0 10px #ff6b35, 0 0 20px #ff6b35, 0 0 30px #ff6b35;
    }
}

/* Loading Spinner */
.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Achievement Badge Glow */
.achievement-glow {
    box-shadow: 0 0 20px rgba(255, 193, 7, 0.6);
    animation: glow 2s ease-in-out infinite alternate;
}

@keyframes glow {
    from {
        box-shadow: 0 0 20px rgba(255, 193, 7, 0.6);
    }
    to {
        box-shadow: 0 0 30px rgba(255, 193, 7, 0.8);
    }
}

/* Success Celebration */
.celebration {
    position: relative;
    overflow: hidden;
}

.celebration::before {
    content: '🎉✨🎊';
    position: absolute;
    top: -10px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 2rem;
    animation: celebrate 3s ease-in-out;
    pointer-events: none;
}

@keyframes celebrate {
    0% {
        transform: translateX(-50%) translateY(100px);
        opacity: 0;
    }
    50% {
        transform: translateX(-50%) translateY(-10px);
        opacity: 1;
    }
    100% {
        transform: translateX(-50%) translateY(-100px);
        opacity: 0;
    }
}

/* Utility Classes */
.text-gradient {
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.shadow-custom {
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1) !important;
}

.border-custom {
    border: 3px solid transparent;
    background: linear-gradient(white, white) padding-box,
                var(--gradient-primary) border-box;
}

/* Accessibility Improvements */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Focus Indicators */
button:focus,
.btn:focus,
.form-control:focus,
.form-select:focus {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

/* High Contrast Mode Support */
@media (prefers-contrast: high) {
    .card {
        border: 2px solid #000;
    }
    
    .btn {
        border: 2px solid #000;
    }
}

/* Reduced Motion Support */
@media (prefers-reduced-motion: reduce) {
    *,
    ::before,
    ::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* UI/UX Design Rules: Persistent Tooltips and Alerts */
.tooltip {
    position: relative !important;
    z-index: 1000 !important;
    opacity: 1 !important;
    visibility: visible !important;
    pointer-events: auto !important;
}

.alert {
    position: relative !important;
    z-index: 1000 !important;
    opacity: 1 !important;
    visibility: visible !important;
    margin-bottom: 1rem !important;
}

/* Ensure tooltips don't auto-hide */
.tooltip.fade:not(.show) {
    opacity: 1 !important;
    visibility: visible !important;
}

/* Better tooltip readability */
.tooltip-inner {
    max-width: 300px !important;
    text-align: left !important;
    white-space: normal !important;
    word-wrap: break-word !important;
}
