/* Variables - Dark Professional Theme */
:root {
    --primary-color: #0d6efd;
    --accent-blue: #4a9eff;
    --accent-green: #5dd68d;
    --accent-dark: #0a1f2e;
    --secondary-color: #a0a0a0;
    --bs-secondary-color: #a0a0a0;
    --success-color: #198754;
    --danger-color: #dc3545;
    --light-bg: #0f1419;
    --glow-blue: 0 0 15px rgba(74, 158, 255, 0.25);
    --glow-green: 0 0 15px rgba(93, 214, 141, 0.25);
}

/* General Styles - Dark Futuristic */
html, body {
    overflow-x: hidden;
}

body {
    background: linear-gradient(135deg, #0f1419 0%, #1a2332 100%);
    font-family: 'Courier New', 'Segoe UI', monospace;
    color: #e0e0e0;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
}

.profile-loader {
    text-align: center;
    padding: 2rem 0;
    color: #cfe7ff;
}

/* TEST Environment - Slightly orange-tinted background */
body.env-test {
    background: linear-gradient(135deg, #2a1a0f 0%, #3a2a1a 100%);
}

body.env-test .telegram-widget-prod {
    display: none;
}

body:not(.env-test) .telegram-widget-test {
    display: none;
}

/* Test environment card overrides - blend with brown theme */
body.env-test .challenge-card,
body.env-test #challengeProgressContainer .card,
body.env-test .stats-card,
body.env-test .medal-container {
    background: linear-gradient(135deg, rgba(42, 26, 15, 0.6) 0%, rgba(58, 42, 26, 0.6) 100%);
    border-color: rgba(255, 214, 170, 0.15);
}

body.env-test .navbar {
    background: linear-gradient(135deg, rgba(20, 12, 7, 0.9) 0%, rgba(30, 18, 10, 0.9) 100%);
}

/* Main Container */
main {
    backdrop-filter: blur(10px);
    flex: 1;
    overflow-y: auto;
    margin-top: 2px;
}

@media (max-width: 576px) {
    main.container {
        margin-top: 1rem !important;
        margin-bottom: 1rem !important;
    }

    footer.mt-5 {
        margin-top: 1rem !important;
    }

    #challengePrizeTypeBadge {
        display: block;
        margin-top: 0.5rem;
        margin-left: 0;
        font-size: 0.8em;
        flex-basis: 100%;
        word-break: break-word;
        overflow-wrap: break-word;
        max-width: 100%;
    }

    .modal-header {
        flex-wrap: wrap;
    }
}

/* Navbar Separators */
@media (min-width: 992px) {
    .navbar .nav-separator .nav-item:not(:last-child) {
        border-right: 1px solid rgba(74, 158, 255, 0.2);
        padding-right: 1rem;
        margin-right: 1rem;
    }
}

/* Navbar Dropdown */
.navbar .dropdown-menu {
    background: linear-gradient(135deg, #0a1f2e 0%, #132942 100%);
    border: 1px solid rgba(74, 158, 255, 0.2);
    border-radius: 4px;
}

.navbar .dropdown-menu .dropdown-item {
    color: #e0e0e0;
}

.navbar .dropdown-menu .dropdown-item:hover,
.navbar .dropdown-menu .dropdown-item:focus {
    background: rgba(74, 158, 255, 0.15);
    color: #5dcbd6;
}

.navbar .dropdown-menu .dropdown-divider {
    border-color: rgba(74, 158, 255, 0.1);
}


.navbar {
    background: linear-gradient(90deg, #0a1f2e 0%, #132942 100%);
    border-bottom: 1px solid rgba(74, 158, 255, 0.3);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.navbar .d-flex {
    align-items: center !important;
}

.navbar .small {
    align-self: center;
}

.bg-warning {
  background-color: rgb(72, 72, 72) !important;
}

#userDropdownContainer {
    margin-top: -4px;
}

.navbar-brand {
    font-size: 1.5rem;
    letter-spacing: 2px;
    color: #ffffff !important;
    font-weight: 700;
    text-transform: uppercase;
}

/* Login link styling */
#navLoginBtn {
    color: #e0e0e0 !important;
    text-decoration: none;
    transition: color 0.3s ease;
}

#navLoginBtn:hover {
    color: #5dcbd6 !important;
}

/* Hide date on small screens (< 485px) */
@media (max-width: 484px) {
    .date-mobile-hide {
        display: none;
    }
}

/* Navbar title changes for small screens */
@media (max-width: 369px) {
    .navbar-brand {
        font-size: 0 !important;
        letter-spacing: 0;
    }
    .navbar-brand::after {
        content: 'GVA IS CALLING';
        font-size: 0.9rem;
        letter-spacing: 1px;
    }
}

@media (max-width: 327px) {
    .navbar-brand {
        display: none;
    }
    .navbar-brand::after {
        display: none;
    }
}

/* Challenge Cards - Clean & Minimal */
.challenge-card {
    background: linear-gradient(135deg, #1a2f45 0%, #0f2338 100%);
    border: 1px solid rgba(74, 158, 255, 0.2);
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
    transition: all 0.4s cubic-bezier(0.23, 1, 0.320, 1);
    cursor: pointer;
    overflow: hidden;
    position: relative;
    min-height: 550px;
    display: flex;
    flex-direction: column;
}

.challenge-card::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(45deg, transparent, rgba(93, 214, 141, 0.05), transparent);
    transform: rotate(45deg);
    animation: shimmer 3s infinite;
}

@keyframes shimmer {
    0% { transform: translateX(-100%) translateY(-100%) rotate(45deg); }
    100% { transform: translateX(100%) translateY(100%) rotate(45deg); }
}

.challenge-card:hover {
    transform: translateY(-4px);
    border-color: rgba(93, 214, 141, 0.4);
    box-shadow: 0 4px 16px rgba(93, 214, 141, 0.1);
}

.challenge-card-image {
    width: 100%;
    aspect-ratio: 16 / 9;
    object-fit: cover;
    border-bottom: 1px solid rgba(74, 158, 255, 0.15);
    opacity: 0.9;
    transition: opacity 0.3s ease;
}

.challenge-card:hover .challenge-card-image {
    opacity: 1;
}

.challenge-card .card-body {
    padding: 1.5rem;
    background: rgba(15, 35, 56, 0.8);
    flex: 1;
    display: flex;
    flex-direction: column;
}

.card-title {
    color: #ffffff;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.card-text {
    color: #999;
    font-size: 0.9rem;
    flex: 1;
}

.challenge-card .btn {
    margin-top: auto;
}

/* Badges - Minimal & Clear */
.challenge-badge {
    display: inline-block;
    padding: 0.4rem 0.8rem;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border: none;
    transition: all 0.3s ease;
}

.challenge-badge.status-pending {
    background-color: rgba(74, 158, 255, 0.15);
    color: #4a9eff;
}

.challenge-badge.status-completed {
    background-color: rgba(93, 214, 141, 0.15);
    color: #5dd68d;
}

.challenge-badge.status-in-progress {
    background-color: rgba(255, 200, 0, 0.15);
    color: #ffc800;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

/* Modal Styles - Clean & Professional */
.modal-content {
    background: linear-gradient(135deg, #0f1419 0%, #1a2332 100%);
    border: 1px solid rgba(74, 158, 255, 0.15);
    border-radius: 8px;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.4);
}

.modal-header {
    background: linear-gradient(90deg, #0a1f2e 0%, #132942 100%);
    border-bottom: 1px solid rgba(74, 158, 255, 0.1);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.modal-title {
    color: #ffffff;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1.5px;
}

.challenge-modal-image {
    width: 100%;
    object-fit: contain;
    height: auto;
    opacity: 0.95;
    display: block;
    margin: 0 0 1.5rem 0;
}

/* Challenge Modal Padding Adjustments */
#challengeModal .modal-body {
    padding: 0;
}

#challengeModal.modal {
    padding-left: 0 !important;
    padding-right: 0 !important;
}

#challengeModal .modal-dialog {
    padding-left: 10px !important;
    padding-right: 10px !important;
}

#challengeModal #challengeDescription {
    padding: 0 1.5rem;
    margin: 0;
}

#challengeModal #answerSection,
#challengeModal #completedSection {
    padding: 1.5rem;
}

/* Form Controls - Clean Tech Style */
.form-control-lg {
    background: rgba(26, 47, 69, 0.5);
    border: 1px solid rgba(74, 158, 255, 0.2);
    color: #ffffff;
    border-radius: 4px;
    font-family: 'Courier New', monospace;
    font-weight: 500;
    transition: all 0.3s ease;
}

.form-control-lg::placeholder {
    color: rgba(255, 255, 255, 0.3);
}

.form-control-lg:focus {
    background: rgba(26, 47, 69, 0.7);
    border-color: rgba(93, 214, 141, 0.4);
    color: #ffffff;
    box-shadow: 0 0 0 0.2rem rgba(93, 214, 141, 0.15);
}

#answerInput:disabled,
#answerInput[disabled] {
    background-color: lightslategray;
}

/* Label Styling */
.form-label {
    color: #ffffff;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-size: 0.85rem;
}

/* Progress Bar - Gradient */
.progress {
    height: 8px;
    border-radius: 4px;
    background-color: rgba(26, 47, 69, 0.6);
    border: none;
}

.progress-bar {
    background: linear-gradient(90deg, #4a9eff, #5dd68d);
    transition: width 0.4s ease;
    min-width: 20px;
}

/* Step Indicator */
#stepIndicator {
    color: #a0a0a0;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    display: block;
    width: 100%;
    margin-top: 0.8rem;
    font-size: 0.75rem;
    background: rgba(93, 214, 141, 0.05);
    padding: 0.4rem 0.8rem;
    border-radius: 4px;
    border-left: 3px solid #5dd68d;
}

/* Buttons - Clean Style */
.btn-primary {
    background: linear-gradient(135deg, #4a9eff 0%, #3d7fcc 100%);
    border: none;
    color: white;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    border-radius: 4px;
    box-shadow: 0 2px 8px rgba(74, 158, 255, 0.15);
    transition: all 0.3s ease;
}

.btn-primary:hover {
    background: linear-gradient(135deg, #5dcbd6 0%, #53868b 100%);
    box-shadow: 0 4px 12px rgba(93, 214, 141, 0.2);
    transform: translateY(-2px);
}

.btn-primary:active {
    transform: translateY(0);
}

/* Alerts & Feedback */
.alert {
    border: none;
    border-radius: 4px;
    font-weight: 600;
    letter-spacing: 0.5px;
}

.alert-success {
    background: rgba(93, 214, 141, 0.15);
    color: #5dd68d;
}

.alert-danger {
    background: rgba(220, 53, 69, 0.15);
    color: #ff7b7b;
}

/* Loading Spinner */
.spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid rgba(74, 158, 255, 0.2);
    border-top-color: #5dcbd6;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Footer */
footer {
    background: linear-gradient(90deg, #0a1f2e 0%, #132942 100%);
    border-top: 1px solid rgba(74, 158, 255, 0.1);
    color: #808080;
    margin-top: auto;
    padding-left: 10px;
    padding-right: 10px;
}

/* Responsive */
@media (max-width: 768px) {
    .navbar-brand {
        font-size: 1.1rem;
        letter-spacing: 1px;
    }

    .challenge-card {
        min-height: 350px;
    }

    .challenge-card .card-body {
        padding: 1rem;
    }
    
    /* Reduce prize spacing on mobile */
    .challenge-card .card-body p.mb-2 {
        margin-bottom: 0.5rem !important;
    }

    .modal-lg {
        max-width: 95vw;
        margin-left: auto !important;
        margin-right: auto !important;
    }
}

/* User Avatar */
.user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
    border: 1px solid rgba(74, 158, 255, 0.3);
}

/* Leaderboard Styles */
.stats-card {
    background: linear-gradient(135deg, #1a2f45 0%, #0f2338 100%);
    border: 1px solid rgba(74, 158, 255, 0.2);
    border-radius: 8px;
    padding: 1.5rem;
    text-align: center;
}

.stats-card h6 {
    color: #4a9eff;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 0.5rem;
    font-size: 0.75rem;
}

.stats-card h3 {
    color: #5dcbd6;
    font-weight: 700;
    font-size: 2rem;
    margin: 0.5rem 0;
}

.leaderboard-section {
    background: linear-gradient(135deg, #1a2f45 0%, #0f2338 100%);
    border: 1px solid rgba(74, 158, 255, 0.2);
    border-radius: 8px;
    padding: 0;
    overflow: hidden;
    overflow-x: scroll;
}

.leaderboard-table {
    margin-bottom: 0;
    color: #e0e0e0;
}

.leaderboard-table thead {
    background: rgba(0, 0, 0, 0.3);
    border-bottom: 1px solid rgba(74, 158, 255, 0.2);
}

.leaderboard-table thead th {
    color: #4a9eff;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 1.25rem;
    border: none;
}

.leaderboard-table tbody td {
    padding: 1.25rem;
    border-bottom: 1px solid rgba(74, 158, 255, 0.1);
    vertical-align: middle;
}

.leaderboard-table tbody tr:hover {
    background: rgba(74, 158, 255, 0.05);
}

.leaderboard-row-current-user {
    background: rgba(93, 214, 141, 0.08) !important;
    border-left: 3px solid #5dcbd6;
}

.rank-cell {
    font-weight: 700;
    text-align: center;
}

.rank-badge {
    background: linear-gradient(135deg, #4a9eff, #5dcbd6);
    color: white;
    padding: 0.4rem 0.8rem;
    border-radius: 50%;
    font-weight: 700;
    display: inline-block;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.points-badge {
    background: rgba(93, 214, 141, 0.15);
    color: #5dd68d;
    padding: 0.4rem 0.8rem;
    border-radius: 4px;
    font-weight: 700;
    font-size: 1.1rem;
}

/* FAQ Styles */
.faq-item {
    background: linear-gradient(135deg, #1a2f45 0%, #0f2338 100%);
    border: 1px solid rgba(74, 158, 255, 0.2) !important;
    border-radius: 8px;
    margin-bottom: 1rem;
    overflow: hidden;
}

.faq-item .accordion-button {
    background: transparent;
    color: #ffffff;
    letter-spacing: 0.5px;
    border: none;
    padding: 1.25rem;
}

.faq-item .accordion-button .faq-title {
    flex: 1 1 auto;
    min-width: 0;
    display: inline;
    white-space: normal;
}

.faq-item .accordion-button .faq-title-highlight {
    color: #7fdcff;
    font-weight: 600;
}

.faq-item .accordion-button:not(.collapsed) {
    background: rgba(74, 158, 255, 0.1);
    color: #5dcbd6;
}

.faq-item .accordion-button:focus {
    border-color: transparent;
    box-shadow: none;
    background: rgba(74, 158, 255, 0.1);
}

.faq-item .accordion-collapse {
    border-top: 1px solid rgba(74, 158, 255, 0.1);
}

.faq-item .accordion-body {
    background: rgba(15, 20, 25, 0.5);
    color: #b0b0b0;
    border: none;
    padding: 1.5rem;
}

.faq-item .accordion-body p {
    margin-bottom: 1rem;
}

.faq-item .accordion-body ul {
    margin-bottom: 0;
}

.faq-item .accordion-body li {
    margin-bottom: 0.5rem;
}

.faq-sidebar {
    position: sticky;
    top: 20px;
}

.faq-card {
    background: linear-gradient(135deg, #1a2f45 0%, #0f2338 100%);
    border: 1px solid rgba(74, 158, 255, 0.2);
    border-radius: 8px;
    padding: 1.5rem;
}

.faq-card h5 {
    color: #4a9eff;
    font-weight: 400;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 1rem;
}

.faq-card ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.faq-card li {
    color: #b0b0b0;
    margin-bottom: 0.5rem;
    padding-left: 1.25rem;
    position: relative;
}

.faq-card li:before {
    content: "→";
    position: absolute;
    left: 0;
    color: #5dcbd6;
    font-weight: 700;
}

/* Responsive */
@media (max-width: 768px) {
    .faq-sidebar {
        margin-top: 2rem;
        position: static;
    }

    .leaderboard-table thead th,
    .leaderboard-table tbody td {
        padding: 0.75rem 0.5rem;
        font-size: 0.9rem;
    }

    .rank-badge {
        width: 32px;
        height: 32px;
        font-size: 0.9rem;
    }
}

/* Profile Page - Challenge Progress Cards */
#challengeProgressContainer .card {
    background: linear-gradient(135deg, #1a2f45 0%, #0f2338 100%);
    border: 1px solid rgba(74, 158, 255, 0.2);
    border-radius: 8px;
}

#challengeProgressContainer .card-body {
    padding: 1rem;
}

#challengeProgressContainer .d-flex {
    flex-wrap: wrap;
    gap: 1rem;
}

#challengeProgressContainer .d-flex > div {
    flex: 1;
    min-width: 0;
}

#challengeProgressContainer .badge {
    white-space: nowrap;
    align-self: flex-start;
}

#challengeProgressContainer .card-title {
    margin-bottom: 0.25rem;
    font-size: 1rem;
}

#challengeProgressContainer .card-text {
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
}

#challengeProgressContainer .progress {
    height: 0.75rem;
    margin: 0.5rem 0;
}

#challengeProgressContainer .progress-bar {
    font-size: 0.7rem;
}

#challengeProgressContainer small {
    display: inline-block;
}

/* Answer Label - Word Wrap for Long Words */
#answerLabel {
    word-wrap: break-word;
    overflow-wrap: break-word;
    word-break: break-word;
    white-space: normal;
    font-size: 1.3rem;
    line-height: 1.6;
    color: #ffffff;
}

/* Fix modal backdrop issues */
body.modal-open {
    overflow: hidden;
}

.modal-backdrop {
    background-color: rgba(0, 0, 0, 0.5);
}

.modal-backdrop.show {
    opacity: 1;
}

.bg-info {
    background-color: rgb(22, 161, 189) !important;
}

/* Leaderboard Dark Background */
#leaderboardContent {
    background-color: rgba(23, 33, 43, 0.6) !important;
    border-radius: 8px;
    padding: 20px;
}

.leaderboard-section {
    background-color: rgba(23, 33, 43, 0.7) !important;
    border-radius: 8px;
    overflow: hidden;
    overflow-x: scroll;
}

.leaderboard-table {
    background-color: rgba(23, 33, 43, 0.8) !important;
    margin-bottom: 0;
}

.leaderboard-table thead th {
    background-color: rgba(23, 33, 43, 0.95) !important;
    border-color: rgba(255, 255, 255, 0.1) !important;
    color: #e0e0e0;
    font-weight: 600;
}

.leaderboard-table tbody td {
    background-color: rgba(23, 33, 43, 0.7) !important;
    border-color: rgba(255, 255, 255, 0.05) !important;
    color: #e0e0e0;
    vertical-align: middle;
}

.leaderboard-table tbody tr:hover {
    background-color: rgba(23, 33, 43, 0.85) !important;
}

.rounded-circle {
    border-width: 1px;
    border-style: solid;
    border-color: cornflowerblue;
}
