/* Brain Stem - Scale.com Inspired Dark Theme */

/* ============================================
   CSS Variables
   ============================================ */
:root {
    /* RGB format for transparency support */
    --primary: 64, 203, 52;
    --primary-dark: 53, 168, 43;
    --secondary: 102, 255, 153;
    /* Hex format for solid colors */
    --dark: #000000;
    --dark-lighter: #0A0A0A;
    --dark-card: #050505;
    --light: #FFFFFF;
    --gray: #A3A3A3;
    --gray-dark: #525252;
    --border: rgba(255, 255, 255, 0.1);
    --gradient: radial-gradient(398.67% 100% at 50% 100%, rgba(var(--primary), 0.15) 0%, rgba(0, 0, 0, 0) 100%);
    --ai-gradient: linear-gradient(135deg, rgb(var(--primary)) 0%, rgb(var(--secondary)) 100%);
    --gradient-bg: linear-gradient(135deg, var(--light) 0%, rgb(var(--secondary)) 100%);
    --hero-gradient: radial-gradient(50% 50% at 50% 50%, rgba(var(--primary), 0.15) 0%, rgba(0, 0, 0, 0) 100%);
}

/* ============================================
   Base Reset & Typography
   ============================================ */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    background-color: var(--dark);
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    line-height: 1.6;
    color: var(--light);
    background: var(--dark);
    overflow-x: hidden;
}

a {
    color: rgb(var(--primary));
    text-decoration: none;
    transition: color 0.2s ease;
}

a:hover {
    color: rgb(var(--secondary));
}

h1 {
    font-size: clamp(2rem, 5vw, 3rem);
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: 1.5rem;
    letter-spacing: -0.02em;
    background: var(--gradient-bg);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

h2 {
    font-size: clamp(2.25rem, 5vw, 3.25rem);
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: 1.5rem;
    letter-spacing: -0.02em;
    background: var(--gradient-bg);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

h3 {
    font-size: 1.5rem;
    margin-bottom: .5rem;
    color: var(--light);
    margin-block-start: 0.83em;
    margin-block-end: 0.83em;
    margin-inline-start: 0px;
    margin-inline-end: 0px;
    font-weight: bold;
}

p {
    font-size: 1.25rem;
    color: var(--gray);
    margin-bottom: 3rem;
    line-height: 1.7;
}

section {
    width: 100%;
    padding-top: 1rem;
    padding-bottom: 0;
    background: transparent;
    position: relative;
    z-index: 1;
}

/* Reduce top padding when section follows hero (hero already has bottom padding) */
.hero + section {
    padding-top: 1rem;
}

/* ============================================
   Layout - Container & Section
   ============================================ */
.container {
    width: 100%;
    margin: 0 auto;
    padding: 0 2rem;
}

.centered {
    text-align: center;
}

/* ============================================
   Page Header - Top section of pages
   ============================================ */
.page-header {
    width: 100%;
    padding: 6rem 0 3rem 0;
    background: transparent;
    position: relative;
    z-index: 1;
    text-align: center;
}

/* ============================================
   Section Header - Titles with badges
   ============================================ */

.section-heading {
    font-size: 2rem;
    color: var(--light);
    margin-bottom: 1rem;
    font-weight: 700;
}
.section-header {
    text-align: center;
    margin-bottom: 1rem;
}

.section-badge {
    display: inline-block;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border);
    color: var(--gray);
    padding: 1.25rem 2.5rem;
    border-radius: 50px;
    font-size: 1.5rem;
    font-weight: 500;
    margin-bottom: 1rem;
}

.section-title {
    font-size: clamp(2rem, 4vw, 3.5rem);
    font-weight: 700;
    color: var(--light);
    margin-bottom: 1rem;
    letter-spacing: -0.02em;
}

.section-subtitle {
    font-size: 1.25rem;
    color: var(--gray);
}

/* ============================================
   Typography Classes
   ============================================ */

.paragraph-bold {
    font-size: 1.25rem;
    color: var(--light);
    font-weight: bold;
    margin-bottom: 2rem;
    line-height: 1.7;
}
/* ============================================
   Background Elements
   ============================================ */
.page-background-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    background-image: url('/img/brain_people_transparent.png');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    opacity: 0.1;
}

#bg-canvas {
    display: none;
}

/* ============================================
   Cards
   ============================================ */
.card {
    padding: 1.5rem;
    background: rgba(var(--primary), 0.015);
    border-left: 3px solid rgb(var(--primary));
    border-radius: 8px;
    transition: all 0.3s ease;
    display: block;
    text-decoration: none;
}

.card:hover {
    transform: translateY(-5px);
    background: rgba(var(--primary), 0.03);
    box-shadow: 0 10px 30px rgba(var(--primary), 0.05);
}

.card h4, .card-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--light);
    margin-bottom: 0.75rem;
}

.card p, .card-text {
    font-size: 0.9rem;
    color: var(--gray);
    line-height: 1.6;
    margin: 0;
}

.card h2 a {
    color: var(--light);
    text-decoration: none;
    transition: color 0.3s ease;
}

.card h2 a:hover {
    color: rgb(var(--primary));
}

.card-bordered {
    padding: 1.5rem;
    background: rgba(var(--primary), 0.03);
    border: 1px solid var(--border);
    border-radius: 12px;
    transition: all 0.3s ease;
    display: block;
    text-decoration: none;
}

.card-bordered:hover {
    transform: translateY(-5px);
    border-color: rgb(var(--primary));
    box-shadow: 0 10px 30px rgba(var(--primary), 0.1);
}

.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    width: 100%;
}

/* ============================================
   Badges
   ============================================ */
.category-badge {
    display: inline-block;
    background: rgba(var(--primary), 0.1);
    color: rgb(var(--primary));
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-size: 0.875rem;
    font-weight: 600;
    margin-bottom: 1rem;
}

/* ============================================
   Lists
   ============================================ */
.principles-list {
    font-size: 1.125rem;
    line-height: 2;
    color: var(--light);
    list-style: none;
    padding: 0;
    margin-top: 2rem;
}

.principles-list li {
    margin-bottom: 1rem;
}

.principles-list strong {
    color: rgb(var(--primary));
}

/* ============================================
   Hero
   ============================================ */

.list-bold {
    list-style: none;
    padding: 0;
    text-align: left;
    display: inline-block;
    margin: 4rem auto 3rem auto;
    font-size: 1.25rem;
}

.list-bold li {
    margin: 0.75rem 0;
    padding-left: 1.5rem;
    position: relative;
    color: var(--light);
}

.list-bold li::before {
    content: "→";
    position: absolute;
    left: 0;
    color: rgb(var(--primary));
    font-weight: bold;
}

.list-bold a {
    color: rgb(var(--primary));
    text-decoration: none;
    font-weight: 600;
    border-bottom: 2px solid transparent;
    transition: all 0.2s;
}

.list-bold a:hover {
    border-bottom-color: rgb(var(--primary));
    color: rgb(var(--secondary));
}

/* ============================================
   Buttons
   ============================================ */
button {
    background: rgb(var(--primary));
    color: var(--dark);
    padding: 1rem 2rem;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 700;
    font-size: 1rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    transition: all 0.2s;
    border: none;
    cursor: pointer;
    box-shadow: 0 4px 20px rgba(var(--primary), 0.3);
}

button:hover {
    background: rgb(var(--primary-dark));
    transform: translateY(-2px);
    box-shadow: 0 6px 30px rgba(var(--primary), 0.4);
}

.btn-primary, .btn-secondary {
    font-size: 1.125rem;
}

.btn-secondary {
    background: transparent;
    border: 2px solid rgb(var(--primary));
    color: rgb(var(--primary));
    border-radius: 8px;
    text-decoration: none;
    font-weight: 700;
    transition: all 0.2s;
}

.btn-secondary:hover {
    background: rgba(var(--primary), 0.1);
    border-color: rgb(var(--primary));
    transform: translateY(-2px);
}

/* ============================================
   Badges & Gamification
   ============================================ */
.badge-collection {
    margin-top: 1.5rem;
}

.badge-section-title {
    color: var(--gray);
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 1rem;
}

.badge-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 1rem;
}

.badge-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 1rem 0.5rem;
    background: rgba(var(--primary), 0.03);
    border: 1px solid rgba(var(--primary), 0.1);
    border-radius: 8px;
    transition: transform 0.2s, box-shadow 0.2s;
}

.badge-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(var(--primary), 0.15);
}

.badge-icon {
    font-size: 2rem;
    padding: 0.5rem;
    border: 2px solid #cd7f32;
    border-radius: 50%;
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 0.5rem;
    background: rgba(0, 0, 0, 0.3);
}

.badge-name {
    font-size: 0.85rem;
    color: var(--light);
    font-weight: 500;
    margin-bottom: 0.25rem;
}

.badge-tier {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.badge-points {
    font-size: 0.7rem;
    color: rgb(var(--primary));
    margin-top: 0.25rem;
}

.badge-progress-section {
    margin-top: 1.5rem;
}

.badge-progress-item {
    background: rgba(var(--primary), 0.03);
    border: 1px solid rgba(var(--primary), 0.1);
    border-radius: 8px;
    padding: 1rem;
    margin-bottom: 0.75rem;
}

.badge-progress-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.5rem;
}

.badge-progress-icon {
    font-size: 1.25rem;
}

.badge-progress-name {
    flex: 1;
    font-weight: 500;
    color: var(--light);
}

.badge-progress-values {
    font-size: 0.85rem;
    color: rgb(var(--primary));
}

.badge-progress-bar-container {
    height: 6px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
    overflow: hidden;
    margin-bottom: 0.5rem;
}

.badge-progress-bar {
    height: 100%;
    background: linear-gradient(90deg, var(--primary), #3fcf3f);
    border-radius: 3px;
    transition: width 0.3s ease;
}

.badge-progress-desc {
    font-size: 0.8rem;
    color: var(--gray);
    margin: 0;
}

.badge-admin-actions {
    margin-top: 1.5rem;
    padding-top: 1rem;
    border-top: 1px solid rgba(var(--primary), 0.1);
}

.badge-action-buttons {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
}

#badge-award-modal {
    margin-top: 1rem;
}

.badge-award-form {
    background: rgba(var(--primary), 0.05);
    border: 1px solid rgba(var(--primary), 0.2);
    border-radius: 8px;
    padding: 1.5rem;
}

.badge-select-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.badge-select-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem;
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(var(--primary), 0.1);
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
}

.badge-select-item:hover {
    border-color: rgb(var(--primary));
    background: rgba(var(--primary), 0.05);
}

.badge-select-item input[type="radio"] {
    margin: 0;
}

.badge-select-item label {
    cursor: pointer;
    flex: 1;
}

.badge-select-item .badge-select-name {
    font-weight: 500;
    color: var(--light);
}

.badge-select-item .badge-select-points {
    font-size: 0.75rem;
    color: rgb(var(--primary));
}

/* ============================================
   Modal Dialog
   ============================================ */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(5px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.modal-content {
    background: var(--dark-card);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 2.5rem;
    max-width: 450px;
    width: 90%;
    text-align: center;
    position: relative;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

.modal-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: none;
    border: none;
    color: var(--gray);
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0.25rem 0.5rem;
    line-height: 1;
    transition: color 0.2s;
}

.modal-close:hover {
    color: var(--light);
}

.modal-content h2 {
    font-size: 1.5rem;
    color: var(--light);
    margin-bottom: 1rem;
}

.modal-content p {
    color: var(--gray);
    font-size: 1rem;
    line-height: 1.6;
    margin-bottom: 2rem;
}

.modal-actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

.modal-actions .btn-primary,
.modal-actions .btn-secondary {
    padding: 1rem 1.5rem;
    font-size: 1rem;
}

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

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

/* ============================================
   Responsive
   ============================================ */
@media (max-width: 768px) {
    h1 {
        font-size: 2rem;
    }

    .hero-subtitle {
        font-size: 1.25rem;
    }

    .section-title {
        font-size: 2rem;
    }
}
