:root {
    --space-dark: #0a0e27;
    --space-blue: #1a1f3a;
    --cosmic-purple: #6366f1;
    --stellar-pink: #ec4899;
    --nebula-cyan: #06b6d4;
    --star-gold: #fbbf24;
}

body {
    background: linear-gradient(135deg, var(--space-dark), var(--space-blue));
    color: #e2e8f0;
    min-height: 100vh;
}

body.locked {
    overflow: hidden;
    height: 100vh;
}

body.first-visit {
    animation: fadeIn 2.5s ease-in forwards;
}

body.returning-visit {
    opacity: 1;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

.hero-section {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    padding: 80px 0;
    text-align: center;
}

.hero-section h1 {
    text-shadow:
        0 0 10px rgba(99, 102, 241, 0.8),
        0 0 20px rgba(99, 102, 241, 0.6),
        0 0 30px rgba(99, 102, 241, 0.4),
        0 0 40px rgba(236, 72, 153, 0.3);
    animation: text-glow 2.5s ease-in-out infinite;
}

.hero-section .lead {
    text-shadow:
        0 0 8px rgba(6, 182, 212, 0.6),
        0 0 15px rgba(6, 182, 212, 0.4);
}

@keyframes text-glow {

    0%,
    100% {
        text-shadow:
            0 0 10px rgba(99, 102, 241, 0.8),
            0 0 20px rgba(99, 102, 241, 0.6),
            0 0 30px rgba(99, 102, 241, 0.4),
            0 0 40px rgba(236, 72, 153, 0.3);
    }

    50% {
        text-shadow:
            0 0 15px rgba(99, 102, 241, 1),
            0 0 30px rgba(99, 102, 241, 0.8),
            0 0 45px rgba(99, 102, 241, 0.6),
            0 0 60px rgba(236, 72, 153, 0.5);
    }
}

#stars {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
    overflow: hidden;
}

.star-decoration {
    position: absolute;
    width: 2px;
    height: 2px;
    background: white;
    border-radius: 50%;
    animation: twinkle 2.5s infinite;
    z-index: -1;
    /* Place behind content */
    pointer-events: none;
    /* Allow clicks to pass through */
}

@keyframes twinkle {
    0%, 100% { opacity: 0.1;}
    50% { opacity: 1;}
}

.custom-cosmic {
    background: linear-gradient(45deg, var(--cosmic-purple), var(--stellar-pink));
    border: none;
    color: white;
    padding: 10px 30px;
    border-radius: 25px;
    transition: transform 0.3s, box-shadow 0.3s;
    text-decoration: none;
}

.custom-cosmic:hover {
    transform: scale(1.05);
    box-shadow: 0 5px 20px rgba(99, 102, 241, 0.5);
    color: white;
    cursor: pointer;
}

.navbar, .loginForm{
    background: rgba(26, 31, 58, 0.8) !important;
    backdrop-filter: blur(20px); /* remove stars behind navbar */
    border-bottom: 1px solid rgba(99, 102, 241, 0.3);
    user-select: none;
}

.loginForm{
    border: 1px solid rgba(99, 102, 241, 0.3);
}

.logo {
    font-size: 1.75rem;
    font-weight: bold;
    color: var(--stellar-pink);
}

.task {
    border-left: 3px solid var(--cosmic-purple);
    padding-left: 15px;
    margin-bottom: 15px;
}

.signup-link{
    color: var(--cosmic-purple);
    display: inline-block;
    transition: color 0.35s; /* right before the whole animation */
}

.signup-link::after {
    content: '';
    position: absolute;
    left: 50%;
    bottom: -1px;
    width: 0;
    height: 2px;
    background: linear-gradient(90deg, var(--cosmic-purple), var(--stellar-pink));
    transform: translateX(-50%);
    transition: width 0.4s ease;
}


.signup-link:hover {
    color: var(--stellar-pink); /* change text color on hover */
}

.signup-link:hover:after {
    width: 100%;
}

/* User Dropdown Styles */
.user-dropdown-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 8px;
    border-radius: 50%;
    transition: all 0.3s ease;
    width: 45px;
    height: 45px;
}

.user-dropdown-toggle:hover {
    transform: scale(1.1);
}

.user-dropdown-toggle::after {
    display: none !important; /* Remove Bootstrap's default dropdown arrow */
}

.user-icon {
    font-size: 1.8rem;
    color: var(--stellar-pink);
    margin: 0;
}

/* Cosmic Dropdown Menu */
.cosmic-dropdown {
    background: rgba(26, 31, 58, 0.95);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(99, 102, 241, 0.3);
    border-radius: 5px;
    padding: 0;
    min-width: 240px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

/* User Info Header */
.cosmic-dropdown .dropdown-header {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.2), rgba(236, 72, 153, 0.2));
    border-bottom: 2px solid rgba(99, 102, 241, 0.3);
    padding: 1rem 1.25rem;
    border-radius: 5px 5px 0 0;
}

.user-info {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.username-points {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.dropdown-username {
    font-size: 1.1rem;
    font-weight: 600;
    color: #ffffff;
}

.user-points {
    color: white;
    padding: 4px 12px;
    font-size: 0.9rem;
    font-weight: 600;
}

.user-points i {
    color: #c084fc; /* A soft amethyst base color */
    text-shadow: 0 0 8px rgba(168, 85, 247, 0.7), 
                 0 0 15px rgba(192, 132, 252, 0.4),
                 0 0 25px rgba(88, 28, 135, 0.3); /* Adds depth/outer space glow */
}

.galaxy-info {
    font-size: 0.85rem;
    color: var(--nebula-cyan);
    font-weight: 500;
    padding: 4px 10px;
    margin-top: 12px;
    background: rgba(6, 182, 212, 0.1);
    border-radius: 5px;
    border: 1px solid rgba(6, 182, 212, 0.3);
    display: flex;
    flex-direction: column;
}

.cosmic-dropdown .dropdown-item {
    color: #e2e8f0;
    padding: 0.75rem 1.25rem;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 10px;
}

.cosmic-dropdown .dropdown-item i {
    font-size: 1.1rem;
    width: 20px;
}

.cosmic-dropdown .dropdown-item:hover {
    background: linear-gradient(45deg, rgba(99, 102, 241, 0.2), rgba(236, 72, 153, 0.2));
    color: white;
    padding-left: 1.5rem;
}

.cosmic-dropdown .dropdown-item.text-danger {
    color: #ef4444 !important;
}

.cosmic-dropdown .dropdown-item.text-danger:hover {
    background: rgba(239, 68, 68, 0.1);
    color: #f87171 !important;
}

.cosmic-dropdown .dropdown-divider {
    border-color: rgba(99, 102, 241, 0.2);
    margin: 0;
}

/* Animation for dropdown appearance */
.dropdown-menu.show {
    animation: slideDown 0.2s ease-out;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}


/* Challenge Section */

.challenge-section {
    min-height: 100vh;
    padding-top: 100px;
    position: relative;
}

.section-title {
    font-size: 2rem;
    font-weight: bold;
    color: var(--nebula-cyan);
    text-shadow: 0 0 20px rgba(6, 182, 212, 0.5);
}

.points-display {
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--star-gold);
    background: rgba(251, 191, 36, 0.1);
    padding: 8px 16px;
    border-radius: 20px;
    border: 1px solid rgba(251, 191, 36, 0.3);
}

/* Challenge Cards */
.challenge-card {
    background: rgba(26, 31, 58, 0.8);
    border: 1px solid rgba(99, 102, 241, 0.3);
    border-radius: 15px;
    transition: transform 0.3s, box-shadow 0.3s;
    backdrop-filter: blur(10px);
}

.challenge-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(99, 102, 241, 0.3);
    border-color: var(--cosmic-purple);
}

.challenge-card .card-header {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.2), rgba(236, 72, 153, 0.1));
    border-bottom: 1px solid rgba(99, 102, 241, 0.2);
    border-radius: 15px 15px 0 0;
    padding: 12px 16px;
}

.challenge-card .challenge-id {
    font-weight: bold;
    color: var(--nebula-cyan);
    font-size: 0.9rem;
}

.challenge-card .challenge-points {
    font-weight: bold;
    color: var(--star-gold);
    font-size: 1rem;
}

.challenge-card .card-body {
    padding: 16px;
}

.challenge-card .challenge-desc {
    color: #e2e8f0;
    font-size: 0.95rem;
    line-height: 1.5;
    margin-bottom: 10px;
}

.challenge-card .challenge-creator {
    margin-bottom: 0;
}

.challenge-card .card-footer {
    background: transparent;
    border-top: 1px solid rgba(99, 102, 241, 0.2);
    padding: 12px 16px;
    border-radius: 0 0 15px 15px;
}

.challenge-card .view-challenge-btn {
    font-size: 0.9rem;
    padding: 8px 16px;
}

/* Challenge Detail Modal */
.challenge-detail-info {
    background: rgba(0, 0, 0, 0.2);
    padding: 20px;
    border-radius: 10px;
    border: 1px solid rgba(99, 102, 241, 0.2);
}

.challenge-detail-info .text-muted {
    color: #94a3b8 !important;
}

/* Form controls in modals */
.loginForm .form-control {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(99, 102, 241, 0.3);
    color: #e2e8f0;
    padding: 12px;
    border-radius: 8px;
}

.loginForm .form-control:focus {
    background: rgba(255, 255, 255, 0.08);
    border-color: var(--cosmic-purple);
    box-shadow: 0 0 15px rgba(99, 102, 241, 0.3);
    color: #e2e8f0;
}

.loginForm .form-control::placeholder {
    color: rgba(148, 163, 184, 0.6);
}

.loginForm .modal-label,
.loginForm label {
    color: var(--nebula-cyan);
    font-weight: 500;
    margin-bottom: 8px;
    display: block;
}