/*
=================================================================
MODERNIZED & UNIFIED STYLESHEET FOR ULYS QUEST
VERSION: 2.1
=================================================================
*/

/* --- 1. FOUNDATION & CORE STYLES --- */
:root {
    --primary: #ed1c24;   /* Malta Red - Vibrant Accent */
    --secondary: #ffffff; /* White - For text and highlights */
    --accent: #f9d423;    /* Gold - For special highlights */
    --dark: #b31217;      /* Darker Red - For hover states */
    --bg-dark: #121212;   /* Main dark background */
    --bg-light: #1a1a1a;  /* Lighter dark for card backgrounds */
    --text-light: #e0e0e0;/* Light gray for body text */
    --text-dark: #121212;  /* For use on light backgrounds */
    --border-color: rgba(255, 255, 255, 0.1); /* Standard border color */
}

#gradient-canvas {
    width:100%;
    height:100%;
    position: fixed;
    top: 0;
    left: 0;
    z-index: -2;
}

body {
    font-family: 'DM Sans', system-ui, -apple-system, sans-serif;
    margin: 0;
    padding: 0;
    background-color: var(--bg-dark);
    background-image: linear-gradient(rgba(255, 255, 255, 0.03) 1px, transparent 1px),
                      linear-gradient(90deg, rgba(255, 255, 255, 0.03) 1px, transparent 1px);
    background-size: 50px 50px;
    background-position: 0% 0%;
    color: var(--text-light);
    line-height: 1.7;
    overflow-x: hidden;
    scroll-behavior: smooth;
    position: relative;
}

::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: var(--bg-dark); }
::-webkit-scrollbar-thumb { background: rgba(237, 28, 36, 0.5); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: var(--primary); }

main {
    padding: 40px 20px;
    max-width: 1200px;
    margin: 0 auto;
}

h1, h2, h3 {
    font-family: 'DM Sans', 'DM Sans', cursive;
    color: var(--secondary);
    text-shadow: 0 0 10px rgba(237, 28, 36, 0.5);
}

h1 {
    font-family: 'Pirata One', sans-serif;
    font-size: 4rem;
    margin-bottom: 1rem;
    line-height: 1.1;
    animation: float 3s ease-in-out infinite;
}

@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

h2 {
    font-size: 2.8rem;
    margin-bottom: 2rem;
    text-align: center;
    position: relative;
    display: inline-block;
}

section h2::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 3px;
    background: var(--primary);
    border-radius: 3px;
    box-shadow: 0 0 8px var(--primary);
    transition: width 0.3s ease, box-shadow 0.3s ease;
}

section h2:hover::after {
    width: 90px;
    box-shadow: 0 0 12px var(--primary);
}

p {
    font-size: 1.1rem;
    line-height: 1.8;
    margin-bottom: 1.5rem;
    color: var(--text-light);
}

/* --- 2. NAVIGATION & FOOTER (GLASSMORPHISM) --- */
#main-nav {
    background: rgba(18, 18, 18, 0.5);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border-color);
    padding: 15px;
    position: sticky;
    top: 0;
    z-index: 1000;
    transition: all 0.3s ease;
}

#main-nav ul {
    list-style-type: none;
    margin: 0;
    padding: 0;
    display: flex;
    justify-content: center;
}

#main-nav ul li { margin: 0 15px; }

#main-nav ul li a {
    color: var(--secondary);
    text-decoration: none;
    font-weight: 500;
    font-size: 1rem;
    padding: 8px 16px;
    border-radius: 8px;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
}

#main-nav ul li a:hover {
    background-color: rgba(255, 255, 255, 0.1);
    color: var(--primary);
}

footer {
    background: rgba(18, 18, 18, 0.3);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-top: 1px solid var(--border-color);
    text-align: center;
    color: var(--secondary);
    margin-top: 60px;
    padding: 40px 20px 20px;
    position: relative;
    z-index: 1;
}

.footer-links {
    margin-top: 1rem;
    text-align: center;
    font-size: 0.9rem;
}
.footer-links a {
    color: var(--secondary);
    text-decoration: none;
    transition: color 0.3s ease;
}
.footer-links a:hover {
    color: var(--primary);
    text-decoration: underline;
}

/* --- 3. UNIFIED GLASSMORPHISM CARD STYLE --- */
.content-frame {
    background: linear-gradient(135deg, rgba(26, 26, 26, 0.2), rgba(26, 26, 26, 0.5));
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    border-radius: 16px;
    border: 1px solid var(--border-color);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.37), inset 0 0 10px rgba(255, 255, 255, 0.05);
    padding: 30px;
    margin-bottom: 40px;
    position: relative;
    overflow: hidden;
    text-align: center;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.content-frame:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.5), 0 0 30px rgba(237, 28, 36, 0.3);
}

/* --- 4. BUTTONS --- */
.cta-button {
    font-family: 'Space Mono', monospace;
    display: inline-block;
    background: linear-gradient(45deg, var(--primary), var(--dark));
    color: white;
    text-decoration: none;
    padding: 14px 35px;
    border-radius: 12px;
    font-weight: 700;
    transition: all 0.4s ease;
    border: none;
    cursor: pointer;
    box-shadow: 0 0 25px rgba(237, 28, 36, 0.5);
    position: relative;
    overflow: hidden;
    font-size: 1rem;
}

.cta-button::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 300%;
    height: 300%;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 50%;
    transform: translate(-50%, -50%) scale(0);
    transition: transform 0.6s ease;
}

.cta-button:hover::before {
    transform: translate(-50%, -50%) scale(1);
}

.cta-button:hover {
    box-shadow: 0 0 40px rgba(237, 28, 36, 0.8), 0 0 60px rgba(237, 28, 36, 0.5);
    transform: translateY(-5px);
}

.cta-button:active { transform: translateY(1px); }

/* --- 5. TABLES --- */
.table-wrapper {
    background: rgba(0,0,0,0.2);
    border-radius: 12px;
    padding: 20px;
    border: 1px solid rgba(255,255,255,0.05);
    overflow-x: auto; /* FIX: Allows table to scroll horizontally on small screens */
}

.responsive-table {
    width: 100%;
    border-collapse: collapse;
    color: var(--text-light);
}

.responsive-table th,
.responsive-table td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

.responsive-table thead tr {
    background-color: var(--primary);
    color: white;
    font-weight: bold;
}

.responsive-table tbody tr { transition: background-color 0.3s ease; }
.responsive-table tbody tr:hover { background-color: rgba(237, 28, 36, 0.2); }

/* --- 6. PROFILE PAGE SPECIFIC STYLES --- */
#vq-profile-section.content-frame {
    padding: 15px;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

.loading {
    text-align: center;
    font-size: 1.2rem;
    padding: 40px;
    color: var(--text-light);
}

.error-state {
    color: var(--primary);
    text-align: center;
    padding: 20px;
}

.error-state i {
    font-size: 2rem;
    margin-bottom: 10px;
}

.profile-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 30px;
    align-items: center;
    text-align: center;
    margin-top: 20px;
}

.profile-stat-item h3 {
    font-size: 1.5rem;
    color: var(--text-light);
    margin-bottom: 10px;
    font-weight: normal;
    text-shadow: none;
}

.profile-stat-item h2 {
    text-shadow: none;
}

.profile-stats-heading {
    text-align: center;
}

.quest-progress-heading {
    text-align: center;
    margin-top: 40px;
    font-size: 1.2rem;
    text-shadow: none;
}

.profile-stat-item .stat-value {
    font-family: 'Space Mono', monospace;
    font-size: 2.5rem;
    font-weight: bold;
    color: var(--primary);
    text-shadow: 0 0 10px var(--primary);
}

.progress-bar-container {
    background: rgba(0, 0, 0, 0.3);
    border-radius: 20px;
    overflow: hidden;
    height: 25px;
    margin: 20px auto;
    border: 1px solid var(--border-color);
    max-width: 80%;
}

.progress-bar {
    height: 100%;
    width: 0;
    background: linear-gradient(90deg, var(--dark), var(--primary));
    box-shadow: 0 0 15px var(--primary);
    transition: width 1.5s cubic-bezier(0.25, 1, 0.5, 1);
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: bold;
    font-size: 0.9rem;
}

.empty-state {
    text-align: center;
    padding: 40px 20px;
}

.empty-state i {
    font-size: 4rem;
    color: var(--primary);
    text-shadow: 0 0 15px var(--primary);
    margin-bottom: 20px;
}

.empty-state h2 {
    text-shadow: none;
}

.empty-state p {
    font-size: 1.2rem;
    max-width: 500px;
    margin: 10px auto;
}

/* --- 7. RESPONSIVENESS --- */
.main-heading-container {
    text-align: center;
}

.start-quest-container {
    text-align: center;
    margin: 40px 0;
}

.leaderboard-heading {
    text-align: center;
}

@media (max-width: 768px) {
    h1 { font-size: 2.8rem; }
    h2 { font-size: 2.2rem; }
    p { font-size: 1rem; }

    main { padding: 20px 15px; }

    #main-nav ul {
        justify-content: space-around;
    }
    #main-nav ul li { margin: 0 5px; }
    #main-nav ul li a { padding: 8px 10px; font-size: 0.9rem; }

    .responsive-table {
        border: 0;
    }
    .responsive-table thead {
        display: none;
    }
    .responsive-table tr {
        display: block;
        margin-bottom: .625em;
        border: 1px solid var(--border-color);
        border-radius: 8px;
        padding: 0.5em;
    }
    .responsive-table td {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 0.5em 0;
        border-bottom: 1px dotted var(--border-color);
        font-size: 0.85rem; /* ADDED to make text smaller on mobile */
    }
    .responsive-table td::before {
        content: attr(data-label);
        font-weight: bold;
        color: var(--primary);
    }
    .responsive-table td:last-child {
        border-bottom: 0;
    }
}