﻿:root {
    --primary-color: #4a90e2;
    --secondary-color: #f5a623;
    --accent-color: #7ed321;
    --text-color: #333;
    --bg-color: #f4f7f6;
    --white: #ffffff;
    --header-height: 70px;
    --neon-blue: #00f3ff;
    --neon-purple: #bc13fe;
    --neon-green: #0aff0a;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Poppins', sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    line-height: 1.6;
}

/* Header Styles */
.main-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 2rem;
    height: var(--header-height);
    background-color: #0a0a12; /* Dark Theme Background */
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 4px 20px rgba(0,0,0,0.5);
    position: sticky;
    top: 0;
    z-index: 1000;
    backdrop-filter: blur(10px);
}

.logo h1 {
    font-size: 1.5rem;
    color: #fff;
    font-weight: 700;
    text-shadow: 0 0 15px rgba(74, 144, 226, 0.5);
    letter-spacing: 1px;
}

nav ul {
    display: flex;
    list-style: none;
    gap: 2rem;
    align-items: center;
}

nav a {
    text-decoration: none;
    color: #a0a0a0;
    font-weight: 600;
    transition: all 0.3s ease;
    position: relative;
    padding: 5px 0;
}

nav a:hover,
nav a.active {
    color: #00f3ff; /* Neon Blue */
    text-shadow: 0 0 10px rgba(0, 243, 255, 0.5);
}

nav a::after {
    content: '';
    position: absolute;
    width: 0;
    height: 2px;
    bottom: 0;
    left: 0;
    background-color: #00f3ff;
    transition: width 0.3s ease;
    box-shadow: 0 0 10px rgba(0, 243, 255, 0.8);
}

nav a:hover::after,
nav a.active::after {
    width: 100%;
}

/* Buttons */
.btn {
    padding: 0.6rem 1.5rem;
    border: none;
    border-radius: 50px;
    cursor: pointer;
    font-family: inherit;
    font-weight: 600;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

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

.btn-primary {
    background-color: var(--primary-color);
    color: var(--white);
}

.btn-secondary {
    background-color: var(--secondary-color);
    color: var(--white);
    font-size: 1.1rem;
    padding: 0.8rem 2rem;
}

/* Hero Section */
.hero {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 4rem 2rem;
    min-height: calc(100vh - var(--header-height));
    background: linear-gradient(135deg, #e0f7fa 0%, #fff 100%);
}

.hero-content {
    flex: 1;
    max-width: 600px;
}

.hero-content h2 {
    font-size: 3rem;
    line-height: 1.2;
    margin-bottom: 1.5rem;
    color: #2c3e50;
}

.hero-content p {
    font-size: 1.2rem;
    margin-bottom: 2rem;
    color: #555;
}

.hero-image {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
}

.placeholder-circle {
    width: 400px;
    height: 400px;
    background-color: var(--accent-color);
    border-radius: 50%;
    opacity: 0.2;
    position: relative;
}

.placeholder-circle::after {
    content: 'ðŸŒŽ';
    font-size: 10rem;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    opacity: 1;
}

/* Features Section */
.features {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    padding: 4rem 2rem;
    background-color: var(--white);
}

.feature-card {
    background: var(--bg-color);
    padding: 2rem;
    border-radius: 15px;
    text-align: center;
    transition: transform 0.3s ease;
}

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

.feature-card h3 {
    margin-bottom: 1rem;
    color: var(--primary-color);
}

/* Footer */
footer {
    text-align: center;
    padding: 2rem;
    background-color: #2c3e50;
    color: var(--white);
}

/* Responsive */
@media (max-width: 768px) {
    .hero {
        flex-direction: column;
        text-align: center;
        padding-top: 2rem;
    }

    .hero-content {
        margin-bottom: 3rem;
    }
    
    .main-header {
        flex-direction: column;
        height: auto;
        padding: 1rem;
        gap: 1rem;
    }
    
    nav ul {
        gap: 1rem;
    }
}

/* Admin Dashboard Styles */
.admin-container {
    max-width: 1200px;
    margin: 2rem auto;
    padding: 0 2rem;
}

.admin-container h2 {
    margin-bottom: 2rem;
    color: var(--primary-color);
}

.table-responsive {
    overflow-x: auto;
    background: var(--white);
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    padding: 1rem;
}

table {
    width: 100%;
    border-collapse: collapse;
}

th, td {
    padding: 1rem;
    text-align: left;
    border-bottom: 1px solid #eee;
}

th {
    font-weight: 600;
    color: var(--text-color);
    background-color: #f8f9fa;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.user-thumb {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
}

.badge {
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
}

.badge-admin {
    background-color: #e3f2fd;
    color: #1976d2;
}

.badge-student {
    background-color: #e8f5e9;
    color: #2e7d32;
}

.btn-sm {
    padding: 0.5rem 1rem;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: background 0.2s;
}

.btn-make-admin {
    background-color: var(--primary-color);
    color: white;
}

.btn-make-student {
    background-color: var(--secondary-color);
    color: white;
}

.btn-sm:hover {
    opacity: 0.9;
}

.btn-sm:hover {
    opacity: 0.9;
}

/* Stock Market Styles */
.market-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 2rem;
}

.stats-bar {
    display: flex;
    justify-content: space-around;
    background: var(--white);
    padding: 1.5rem;
    border-radius: 15px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
    margin-bottom: 2rem;
}

.stat-item {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.stat-label {
    font-size: 0.9rem;
    color: #666;
    margin-bottom: 0.5rem;
}

.stat-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-color);
}

.market-layout {
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: 2rem;
}

@media (max-width: 1024px) {
    .market-layout {
        grid-template-columns: 1fr;
    }
}

.market-list-section, .portfolio-section {
    background: var(--white);
    padding: 1.5rem;
    border-radius: 15px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
}

/* Toggle Switch */
.switch {
  position: relative;
  display: inline-block;
  width: 40px;
  height: 24px;
}

.switch input { 
  opacity: 0;
  width: 0;
  height: 0;
}

.slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: #ccc;
  transition: .4s;
}

.slider:before {
  position: absolute;
  content: "";
  height: 16px;
  width: 16px;
  left: 4px;
  bottom: 4px;
  background-color: white;
  transition: .4s;
}

input:checked + .slider {
  background-color: var(--primary-color);
}

input:focus + .slider {
  box-shadow: 0 0 1px var(--primary-color);
}

input:checked + .slider:before {
  transform: translateX(16px);
}

.slider.round {
  border-radius: 34px;
}

.slider.round:before {
  border-radius: 50%;
}

.stock-list-header {
    display: grid;
    grid-template-columns: 1.5fr 1fr 1fr 1fr;
    padding: 1rem;
    font-weight: 600;
    border-bottom: 2px solid #f4f7f6;
    color: #666;
}

.stock-item {
    display: grid;
    grid-template-columns: 1.5fr 1fr 1fr 1fr;
    padding: 1rem;
    align-items: center;
    border-bottom: 1px solid #f4f7f6;
    transition: background 0.2s;
}

.stock-item:hover {
    background: #f8f9fa;
}

.stock-symbol {
    font-weight: 700;
    color: var(--text-color);
}

.stock-name {
    display: block;
    font-size: 0.8rem;
    color: #888;
    font-weight: 400;
}

.price-up { color: #2e7d32; }
.price-down { color: #c62828; }

.tabs {
    display: flex;
    gap: 1rem;
    margin-bottom: 1.5rem;
    border-bottom: 1px solid #eee;
}

.tab-btn {
    background: none;
    border: none;
    padding: 0.5rem 1rem;
    font-size: 1rem;
    cursor: pointer;
    color: #666;
    border-bottom: 3px solid transparent;
}

.tab-btn.active {
    color: var(--primary-color);
    border-bottom-color: var(--primary-color);
    font-weight: 600;
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

.portfolio-table {
    width: 100%;
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    z-index: 2000;
    justify-content: center;
    align-items: center;
}

.modal-content {
    background: var(--white);
    padding: 2rem;
    border-radius: 15px;
    width: 90%;
    max-width: 400px;
    position: relative;
}

.close-modal {
    position: absolute;
    top: 1rem;
    right: 1rem;
    font-size: 1.5rem;
    cursor: pointer;
}

.trade-type-selector {
    display: flex;
    margin: 1.5rem 0;
    background: #f4f7f6;
    border-radius: 8px;
    padding: 0.25rem;
}

.trade-type-btn {
    flex: 1;
    padding: 0.5rem;
    border: none;
    background: none;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
}

.trade-type-btn.active[data-type="buy"] {
    background: var(--white);
    color: #2e7d32;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.trade-type-btn.active[data-type="sell"] {
    background: var(--white);
    color: #c62828;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.total-cost {
    display: flex;
    justify-content: space-between;
    margin: 1.5rem 0;
    font-weight: 700;
    font-size: 1.1rem;
}

/* Profile Page Styles */
.profile-container {
    max-width: 800px;
    margin: 2rem auto;
    padding: 0 2rem;
}

.profile-header {
    text-align: center;
    margin-bottom: 2rem;
}

.profile-card {
    background: var(--white);
    padding: 2rem;
    border-radius: 15px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

.current-avatar-display {
    text-align: center;
    margin-bottom: 2rem;
}

.large-avatar {
    font-size: 5rem;
    display: block;
    margin-bottom: 0.5rem;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 0.8rem;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-family: inherit;
    font-size: 1rem;
}

.emoji-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(40px, 1fr));
    gap: 10px;
    padding: 1rem;
    background: #f8f9fa;
    border-radius: 10px;
}

.emoji-option {
    font-size: 1.5rem;
    cursor: pointer;
    text-align: center;
    padding: 5px;
    border-radius: 5px;
    transition: transform 0.2s, background 0.2s;
}

.emoji-option:hover {
    transform: scale(1.2);
    background: #e9ecef;
}

.emoji-option.selected {
    background: var(--primary-color);
    transform: scale(1.1);
}

.btn-block {
    width: 100%;
    padding: 1rem;
    font-size: 1.1rem;
}

/* Students Grid */
.students-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 2rem;
    padding: 2rem 0;
}

.student-card {
    background: var(--white);
    border-radius: 15px;
    padding: 1.5rem;
    text-align: center;
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    cursor: pointer;
}

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

/* --- New Profile Dashboard Styles --- */
.profile-container-expanded {
    position: relative;
    min-height: 85vh;
    padding: 2rem;
    overflow: hidden;
}

.profile-background {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: -1;
    background-size: cover;
    background-position: center;
    opacity: 0.1; /* Default opacity for pattern backgrounds */
    transition: all 0.5s ease;
}

/* Background Presets */
.bg-default { background-color: #f4f7f6; }
.bg-neon { background: linear-gradient(45deg, #000000, #434343); opacity: 1; }
.bg-nature { background: linear-gradient(120deg, #d4fc79 0%, #96e6a1 100%); opacity: 1; }
.bg-gold { background: linear-gradient(to right, #bf953f, #fcf6ba, #b38728, #fbf5b7, #aa771c); opacity: 1; }
.bg-space { background: radial-gradient(circle at center, #1a1a2e, #16213e, #0f3460); opacity: 1; }

.profile-dashboard {
    display: grid;
    grid-template-columns: 300px 1fr;
    gap: 2rem;
    max-width: 1200px;
    margin: 0 auto;
    position: relative;
    z-index: 1;
}

.profile-sidebar-card {
    background: rgba(255, 255, 255, 0.95);
    padding: 2rem;
    border-radius: 20px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.1);
    text-align: center;
    backdrop-filter: blur(10px);
    height: fit-content;
}

.profile-identity h2 {
    margin: 1rem 0 0.5rem;
    color: var(--text-color);
}

.profile-title-badge {
    display: inline-block;
    background: var(--primary-color);
    color: white;
    padding: 0.2rem 0.8rem;
    border-radius: 15px;
    font-size: 0.8rem;
    margin-bottom: 1.5rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.profile-stats-mini {
    background: #f8f9fa;
    padding: 1rem;
    border-radius: 10px;
    margin-bottom: 1.5rem;
}

.stat-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
}

.money-text {
    font-weight: bold;
    color: #27ae60;
}

.action-buttons {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.profile-room-display {
    background: rgba(255, 255, 255, 0.8);
    padding: 2rem;
    border-radius: 20px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.05);
    backdrop-filter: blur(5px);
}

.room-header {
    border-bottom: 2px solid rgba(0,0,0,0.05);
    padding-bottom: 0.5rem;
    margin-bottom: 1rem;
}

.room-header h3 {
    color: #444;
    font-size: 1.2rem;
}

.badges-shelf {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    min-height: 80px;
    padding: 1rem;
    background: rgba(0,0,0,0.03);
    border-radius: 10px;
    align-items: center;
}

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

.room-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
    background: rgba(255, 255, 255, 0.5);
    padding: 2rem;
    border-radius: 20px;
    border: 8px solid #8b4513; /* Wood frame look */
    box-shadow: inset 0 0 50px rgba(0,0,0,0.1);
}

.decoration-slot {
    aspect-ratio: 1;
    background: rgba(255,255,255,0.3);
    border-radius: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3rem;
    border: 2px dashed rgba(0,0,0,0.1);
    transition: transform 0.2s;
    position: relative;
}

.decoration-slot.filled {
    border: none;
    background: none;
    filter: drop-shadow(0 5px 15px rgba(0,0,0,0.2));
}

.decoration-slot:hover {
    transform: scale(1.05);
    background: rgba(255,255,255,0.5);
}

.deco-icon {
    font-size: 4rem;
}

.about-me-card {
    background: #fff;
    padding: 1.5rem;
    border-radius: 10px;
    position: relative;
}

.era-tag {
    position: absolute;
    bottom: 1rem;
    right: 1rem;
    font-size: 0.8rem;
    color: #888;
    font-style: italic;
}

/* Shop Styles */
.shop-content {
    max-width: 800px;
}

.shop-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid #eee;
}

.shop-tabs {
    display: flex;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.shop-tab {
    padding: 0.5rem 1.5rem;
    border: none;
    background: #f0f2f5;
    border-radius: 20px;
    cursor: pointer;
    font-weight: 600;
    color: #666;
    transition: all 0.2s;
}

.shop-tab.active {
    background: var(--primary-color);
    color: white;
}

.shop-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 1.5rem;
    max-height: 60vh;
    overflow-y: auto;
    padding: 0.5rem;
}

.shop-item {
    background: white;
    border: 1px solid #eee;
    border-radius: 10px;
    padding: 1rem;
    text-align: center;
    transition: transform 0.2s;
    position: relative;
}

.shop-item:hover {
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

.shop-item-icon {
    font-size: 3rem;
    margin-bottom: 0.5rem;
}

.shop-item-price {
    display: block;
    font-weight: bold;
    color: #27ae60;
    margin: 0.5rem 0;
}

.shop-item.owned::after {
    content: "OWNED";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255,255,255,0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    color: #2c3e50;
    border-radius: 10px;
}

.btn-buy {
    width: 100%;
    padding: 0.5rem;
    background: #27ae60;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
}

.btn-buy:hover { background: #219150; }

.btn-equip {
    width: 100%;
    padding: 0.5rem;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
}

.btn-equip.equipped {
    background: #7f8c8d;
    cursor: default;
}

@media (max-width: 768px) {
    .profile-dashboard {
        grid-template-columns: 1fr;
    }
}

/* Badges Page Styles */
.badges-stats {
    background: var(--white);
    padding: 2rem;
    border-radius: 15px;
    margin-bottom: 2rem;
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
}

.progress-bar-container {
    max-width: 600px;
    margin: 0 auto;
}

.progress-label {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: var(--text-color);
}

.progress-track {
    height: 20px;
    background: #eee;
    border-radius: 10px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary-color), #2ecc71);
    transition: width 0.5s ease;
}

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

.badge-card {
    background: var(--white);
    padding: 1.5rem;
    border-radius: 15px;
    text-align: center;
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
    transition: transform 0.3s;
    position: relative;
    overflow: hidden;
}

.badge-card.locked {
    opacity: 0.6;
    filter: grayscale(100%);
    background: #f8f9fa;
}

.badge-card.earned {
    border: 2px solid var(--primary-color);
    background: #f0f9ff;
}

.badge-icon-large {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.badge-info h3 {
    font-size: 1.1rem;
    margin-bottom: 0.5rem;
    color: var(--text-color);
}

.badge-info p {
    font-size: 0.9rem;
    color: #666;
}

.badge-status {
    margin-top: 1rem;
    font-size: 0.8rem;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.badge-card.earned .badge-status {
    color: var(--primary-color);
}

.badge-card.locked .badge-status {
    color: #999;
}

.card-avatar {
    font-size: 4rem;
    margin-bottom: 1rem;
}

.card-info h3 {
    color: var(--text-color);
    margin-bottom: 0.5rem;
    font-size: 1.2rem;
}

.card-badges {
    display: flex;
    justify-content: center;
    gap: 5px;
    margin-top: 0.5rem;
}

.badge-icon {
    font-size: 1.2rem;
    cursor: help;
}

/* Student Modal Styles */
.profile-card-modal {
    text-align: center;
    max-width: 400px;
}

.modal-header-profile {
    margin-bottom: 2rem;
}

.profile-avatar-large {
    font-size: 5rem;
    margin-bottom: 1rem;
}

.badges-container {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.5rem;
    margin-top: 1rem;
}

.badge-pill {
    background: #f0f2f5;
    padding: 0.3rem 0.8rem;
    border-radius: 20px;
    font-size: 0.9rem;
    color: #555;
    display: flex;
    align-items: center;
    gap: 5px;
}

.modal-body-profile {
    text-align: left;
}

.info-group {
    background: #f8f9fa;
    padding: 1rem;
    border-radius: 10px;
    margin-bottom: 1.5rem;
}

.info-group label {
    display: block;
    font-size: 0.8rem;
    color: #888;
    margin-bottom: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.info-group p {
    font-size: 1.1rem;
    color: var(--text-color);
    font-style: italic;
}

.stats-row {
    display: flex;
    gap: 1rem;
}

.stat-box-small {
    flex: 1;
    background: var(--bg-color);
    padding: 1rem;
    border-radius: 10px;
    text-align: center;
}

.stat-box-small .label {
    display: block;
    font-size: 0.8rem;
    color: #666;
    margin-bottom: 0.3rem;
}

.stat-box-small .value {
    display: block;
    font-size: 1.2rem;
    font-weight: bold;
    color: var(--primary-color);
}

/* Market Sidebar Layout */
.market-container {
    display: flex;
    gap: 2rem;
    align-items: flex-start;
}

.market-sidebar {
    width: 80px; /* Thinner sidebar */
    background: var(--white);
    border-radius: 15px;
    padding: 1rem 0.5rem;
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
    position: sticky;
    top: 2rem;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.sidebar-menu {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    width: 100%;
}

.sidebar-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.8rem 0.5rem;
    border: none;
    background: none;
    width: 100%;
    text-align: center;
    font-size: 0.7rem; /* Smaller text */
    color: #666;
    cursor: pointer;
    border-radius: 10px;
    transition: all 0.2s;
}

.sidebar-btn:hover {
    background: #f8f9fa;
    color: var(--primary-color);
}

.sidebar-btn.active {
    background: var(--primary-color);
    color: var(--white);
}

.sidebar-btn .icon {
    font-size: 1.5rem; /* Larger icon */
}

.market-view-content {
    flex: 1;
    width: 100%; /* Ensure it takes full width of flex item */
}

/* Leaderboard Styles */
.leaderboard-table {
    width: 100%;
    border-collapse: collapse;
}

.leaderboard-table th, .leaderboard-table td {
    padding: 1rem;
    text-align: left;
    border-bottom: 1px solid #eee;
}

.leaderboard-table th {
    background: #f8f9fa;
    font-weight: 600;
}

.rank-badge {
    display: inline-block;
    width: 30px;
    height: 30px;
    line-height: 30px;
    text-align: center;
    border-radius: 50%;
    background: #eee;
    font-weight: bold;
    color: #666;
}

.rank-1 { background: #ffd700; color: #fff; }
.rank-2 { background: #c0c0c0; color: #fff; }
.rank-3 { background: #cd7f32; color: #fff; }

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    margin-top: 1.5rem;
}

.stat-box {
    background: #f8f9fa;
    padding: 1.5rem;
    border-radius: 10px;
    text-align: center;
}

.stat-box h4 {
    color: #666;
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
}

.stat-box p {
    font-size: 1.2rem;
    font-weight: bold;
    color: var(--text-color);
}

@media (max-width: 1024px) {
    .market-container {
        flex-direction: column;
    }
    
    .market-sidebar {
        width: 100%;
        position: static;
    }
    
    .sidebar-menu {
        flex-direction: row;
        overflow-x: auto;
    }
    
    .sidebar-btn {
        white-space: nowrap;
    }
}

/* --- Lessons Page Styles --- */

.lessons-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    gap: 1rem;
    flex-wrap: wrap;
}

.search-box {
    position: relative;
    flex: 1;
    min-width: 250px;
}

.search-box input {
    width: 100%;
    padding: 0.8rem 1rem 0.8rem 2.5rem;
    border: 1px solid #ddd;
    border-radius: 25px;
    font-size: 1rem;
}

.search-icon {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: #888;
}

.filter-group {
    display: flex;
    gap: 1rem;
}

.filter-group select {
    padding: 0.8rem;
    border: 1px solid #ddd;
    border-radius: 10px;
    background: white;
    cursor: pointer;
}

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

.lesson-card {
    background: white;
    border-radius: 15px;
    padding: 1.5rem;
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
    transition: transform 0.2s, box-shadow 0.2s;
    cursor: pointer;
    border: 2px solid transparent;
    display: flex;
    flex-direction: column;
}

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

.lesson-card.completed {
    border-color: var(--success-color);
    background: #f8fff9;
}

.lesson-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.badge-tag {
    padding: 0.3rem 0.8rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
}

.badge-tag.basics { background: #e3f2fd; color: #1976d2; }
.badge-tag.strategy { background: #e8f5e9; color: #388e3c; }
.badge-tag.economics { background: #fff3e0; color: #f57c00; }
.badge-tag.history { background: #f3e5f5; color: #7b1fa2; }

.lesson-card h3 {
    margin-bottom: 0.5rem;
    color: var(--text-color);
}

.lesson-card p {
    color: #666;
    font-size: 0.9rem;
    flex-grow: 1;
    margin-bottom: 1.5rem;
}

.lesson-card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.9rem;
    font-weight: 600;
}

.difficulty.beginner { color: #4caf50; }
.difficulty.intermediate { color: #ff9800; }
.difficulty.advanced { color: #f44336; }

.reward {
    color: var(--primary-color);
    background: rgba(0, 113, 227, 0.1);
    padding: 0.3rem 0.6rem;
    border-radius: 5px;
}

/* Lesson Modal Specifics */
.lesson-content {
    max-width: 800px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
}

.lesson-header-modal {
    border-bottom: 1px solid #eee;
    padding-bottom: 1.5rem;
    margin-bottom: 1.5rem;
}

.lesson-meta {
    margin-top: 0.5rem;
    color: #666;
}

.lesson-text {
    font-size: 1.1rem;
    line-height: 1.6;
    margin-bottom: 2rem;
}

.quiz-section {
    background: #f8f9fa;
    padding: 1.5rem;
    border-radius: 10px;
    border: 1px solid #eee;
}

.quiz-question {
    margin-bottom: 1.5rem;
}

.quiz-options {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-top: 0.5rem;
}

.quiz-option {
    background: white;
    padding: 0.8rem;
    border-radius: 8px;
    border: 1px solid #ddd;
    cursor: pointer;
    transition: background 0.2s;
}

.quiz-option:hover {
    background: #f0f0f0;
}

.quiz-feedback {
    margin-top: 1rem;
    padding: 1rem;
    border-radius: 8px;
    font-weight: bold;
    text-align: center;
    display: none;
}

.quiz-feedback.success {
    background: #d4edda;
    color: #155724;
}

.quiz-feedback.error {
    background: #f8d7da;
    color: #721c24;
}

.lessons-progress-bar {
    background: white;
    padding: 1rem;
    border-radius: 10px;
    margin-bottom: 2rem;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

.progress-track {
    height: 10px;
    background: #eee;
    border-radius: 5px;
    margin-top: 0.5rem;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: var(--success-color);
    transition: width 0.5s ease;
}


.lesson-footer {
    margin-top: 2rem;
    text-align: center;
}

.total-cost {
    width: 100%;
    display: flex;
    flex-direction: column;
    margin: 1rem 0;
}

.cost-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
    width: 100%;
}

.total-row {
    font-weight: bold;
    border-top: 1px solid rgba(255,255,255,0.1);
    padding-top: 0.5rem;
    margin-top: 0.5rem;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
}

.lesson-card.completed {
    opacity: 0.7;
    background-color: #f5f5f5;
    border-color: #ccc;
}

.lesson-card.completed:hover {
    transform: none;
    box-shadow: none;
}

/* Real Estate Styles */
.market-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    background: white;
    padding: 1.5rem;
    border-radius: 15px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
}

.user-balance-display {
    display: flex;
    gap: 2rem;
    font-weight: 600;
}

.money-text.success { color: var(--success-color); }
.money-text.error { color: #dc3545; }

.market-tabs {
    display: flex;
    gap: 1rem;
    margin-bottom: 2rem;
}

.info-banner {
    background: #e3f2fd;
    color: #0d47a1;
    padding: 1rem;
    border-radius: 10px;
    margin-bottom: 2rem;
    border-left: 5px solid #2196f3;
}

.real-estate-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 2rem;
}

.real-estate-card {
    background: white;
    border-radius: 15px;
    padding: 1.5rem;
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
    display: flex;
    flex-direction: column;
    gap: 1rem;
    border: 2px solid transparent;
    transition: transform 0.2s;
}

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

.real-estate-card.active-home {
    border-color: var(--primary-color);
    background: #f0f7ff;
}

.re-icon {
    font-size: 3rem;
    text-align: center;
    margin-bottom: 0.5rem;
}

.re-info h3 {
    margin-bottom: 0.5rem;
    color: var(--text-color);
}

.re-desc {
    color: #666;
    font-size: 0.9rem;
    margin-bottom: 1rem;
    min-height: 40px;
}

.re-stats {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.stat-badge {
    padding: 0.3rem 0.8rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
}

.stat-badge.xp { background: #e8f5e9; color: #2e7d32; }
.stat-badge.rent { background: #ffebee; color: #c62828; }
.stat-badge.income { background: #e3f2fd; color: #1565c0; }
.stat-badge.owned { background: #fff3e0; color: #ef6c00; }

.re-actions {
    margin-top: auto;
    display: flex;
    gap: 0.5rem;
}

.re-actions button {
    flex: 1;
    padding: 0.8rem;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    transition: opacity 0.2s;
}

.btn-rent { background: var(--secondary-color); color: white; }
.btn-buy { background: var(--primary-color); color: white; }
.btn-disabled { background: #ccc; cursor: not-allowed; color: #666; }

.re-actions button:hover:not(:disabled) {
    opacity: 0.9;
}

/* Rarity Styles */
.rarity-common { border: 2px solid #b0bec5; background: linear-gradient(135deg, #f5f5f5 0%, #e0e0e0 100%); }
.rarity-uncommon { border: 2px solid #66bb6a; background: linear-gradient(135deg, #e8f5e9 0%, #c8e6c9 100%); box-shadow: 0 0 5px #66bb6a; }
.rarity-rare { border: 2px solid #42a5f5; background: linear-gradient(135deg, #e3f2fd 0%, #bbdefb 100%); box-shadow: 0 0 8px #42a5f5; }
.rarity-epic { border: 2px solid #ab47bc; background: linear-gradient(135deg, #f3e5f5 0%, #e1bee7 100%); box-shadow: 0 0 10px #ab47bc; }
.rarity-legendary { border: 2px solid #ffa726; background: linear-gradient(135deg, #fff3e0 0%, #ffe0b2 100%); box-shadow: 0 0 15px #ffa726; animation: legendary-pulse 2s infinite; }
.rarity-mythic { border: 2px solid #ef5350; background: linear-gradient(135deg, #ffebee 0%, #ffcdd2 100%); box-shadow: 0 0 20px #ef5350; animation: mythic-pulse 1.5s infinite; }

.rarity-tag {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 0.7rem;
    font-weight: bold;
    text-transform: uppercase;
    margin-top: 5px;
    color: white;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.3);
}

.rarity-tag.common { background-color: #78909c; }
.rarity-tag.uncommon { background-color: #43a047; }
.rarity-tag.rare { background-color: #1e88e5; }
.rarity-tag.epic { background-color: #8e24aa; }
.rarity-tag.legendary { background-color: #fb8c00; }
.rarity-tag.mythic { background-color: #e53935; }

@keyframes legendary-pulse {
    0% { box-shadow: 0 0 10px #ffa726; }
    50% { box-shadow: 0 0 20px #ffa726, 0 0 10px #ffd54f; }
    100% { box-shadow: 0 0 10px #ffa726; }
}

@keyframes mythic-pulse {
    0% { box-shadow: 0 0 15px #ef5350; transform: scale(1); }
    50% { box-shadow: 0 0 30px #ef5350, 0 0 15px #ffcdd2; transform: scale(1.02); }
    100% { box-shadow: 0 0 15px #ef5350; transform: scale(1); }
}

/* Update Inventory Item for Rarity */
.inventory-item {
    position: relative;
    transition: transform 0.2s;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: space-between;
    padding: 1rem;
    border-radius: 10px;
    min-height: 180px;
}
.inventory-item:hover {
    transform: translateY(-5px);
    z-index: 10;
}

.inventory-item .item-icon {
    font-size: 3rem;
    margin-bottom: 0.5rem;
}

.inventory-item h4 {
    font-size: 0.9rem;
    text-align: center;
    margin-bottom: 0.5rem;
    color: #333;
}

/* Catalog Styles */
.catalog-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 1rem;
    margin-top: 1rem;
}

.catalog-item {
    background: #f5f5f5;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 1rem;
    text-align: center;
    opacity: 0.6;
    filter: grayscale(100%);
    transition: all 0.3s;
}

.catalog-item.owned {
    opacity: 1;
    filter: grayscale(0%);
    border-color: var(--primary-color);
    background: white;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.catalog-item .icon {
    font-size: 2.5rem;
    display: block;
    margin-bottom: 0.5rem;
}

.catalog-item .name {
    font-size: 0.8rem;
    font-weight: 600;
}

/* --- Profile Home Themes --- */
/* Base transition for smooth switching */
.profile-container-v2 {
    transition: all 0.5s ease;
    border-radius: 24px;
    position: relative;
    overflow: hidden;
}

/* Tent: Canvas, Camping, Nature */
.theme-tent {
    background-color: #d4c5a3;
    background-image: url("data:image/svg+xml,%3Csvg width='40' height='40' viewBox='0 0 40 40' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='%23bfae85' fill-opacity='0.4' fill-rule='evenodd'%3E%3Cpath d='M0 40L40 0H20L0 20M40 40V20L20 40'/%3E%3C/g%3E%3C/svg%3E");
    border: 8px solid #5d4037;
    box-shadow: inset 0 0 50px rgba(0,0,0,0.3);
}
.theme-tent .glass-panel {
    background: rgba(245, 245, 220, 0.9);
    border: 2px dashed #8b4513;
    border-radius: 4px;
    box-shadow: 5px 5px 15px rgba(0,0,0,0.2);
    color: #4e342e;
}
.theme-tent .section-icon {
    text-shadow: none;
    filter: sepia(1) hue-rotate(-50deg) saturate(2);
}
.theme-tent .btn-glow {
    background: #8b4513;
    border: none;
    box-shadow: 2px 2px 0 #5d4037;
}
.theme-tent .money-text { color: #2e7d32; text-shadow: none; font-weight: 800; }


/* Shack: Rough Wood, Scrappy */
.theme-shack {
    background-color: #5d4037;
    background-image: repeating-linear-gradient(90deg, transparent, transparent 50px, rgba(0,0,0,0.2) 50px, rgba(0,0,0,0.2) 53px),
                      repeating-linear-gradient(0deg, transparent, transparent 50px, rgba(0,0,0,0.1) 50px, rgba(0,0,0,0.1) 53px);
    border: 6px solid #3e2723;
}
.theme-shack .glass-panel {
    background: url("data:image/svg+xml,%3Csvg width='20' height='20' viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M0 0h20v20H0z' fill='%238d6e63' fill-opacity='0.8'/%3E%3C/svg%3E");
    border: 4px solid #4e342e;
    border-radius: 2px;
    box-shadow: 3px 3px 0 rgba(0,0,0,0.5);
    color: #fff;
    text-shadow: 1px 1px 0 #000;
}
.theme-shack .section-header h3 {
    font-family: 'Courier New', Courier, monospace;
    text-transform: uppercase;
    letter-spacing: 2px;
}


/* Cabin: Cozy, Warm, Log Cabin */
.theme-cabin {
    background: #3e2723;
    background: radial-gradient(circle at center, #5d4037 0%, #3e2723 100%);
    border: 10px solid #281812;
    box-shadow: inset 0 0 100px rgba(0,0,0,0.8);
}
.theme-cabin .glass-panel {
    background: rgba(62, 39, 35, 0.8);
    border: 2px solid #a1887f;
    border-radius: 16px;
    box-shadow: 0 10px 20px rgba(0,0,0,0.5);
    color: #efebe9;
}
.theme-cabin .section-icon {
    filter: drop-shadow(0 0 5px #ffcc80);
}
.theme-cabin .money-text { color: #ffcc80; text-shadow: 0 0 10px #ff6f00; }


/* House: Clean, Brick, Suburban */
.theme-house {
    background-color: #f5f5f5;
    background-image: 
        linear-gradient(335deg, rgba(0,0,0,0.05) 23px, transparent 23px),
        linear-gradient(155deg, rgba(0,0,0,0.05) 23px, transparent 23px),
        linear-gradient(335deg, rgba(0,0,0,0.05) 23px, transparent 23px),
        linear-gradient(155deg, rgba(0,0,0,0.05) 23px, transparent 23px);
    background-size: 58px 58px;
    background-position: 0px 2px, 4px 35px, 29px 31px, 34px 6px;
    border: 8px solid #fff;
    box-shadow: 0 0 20px rgba(0,0,0,0.1);
}
.theme-house .glass-panel {
    background: #ffffff;
    border: 1px solid #e0e0e0;
    border-radius: 12px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.05);
    color: #333;
}
.theme-house .section-icon {
    text-shadow: none;
    -webkit-text-fill-color: initial;
    color: #1976d2;
}
.theme-house .money-text { color: #2e7d32; text-shadow: none; }
.theme-house .btn-glow {
    background: #1976d2;
    color: white;
    border: none;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
}
.theme-house .btn-glow:hover {
    background: #1565c0;
    transform: translateY(-1px);
}


/* Villa: Modern, Glass, Pool, Luxury */
.theme-villa {
    background: linear-gradient(120deg, #e0c3fc 0%, #8ec5fc 100%);
    border: 1px solid rgba(255,255,255,0.5);
    box-shadow: 0 20px 50px rgba(0,0,0,0.15);
}
.theme-villa .glass-panel {
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.9);
    border-radius: 24px;
    box-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.1);
    color: #2c3e50;
}
.theme-villa .section-icon {
    text-shadow: none;
    -webkit-text-fill-color: initial;
    background: linear-gradient(45deg, #8ec5fc, #e0c3fc);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}
.theme-villa .money-text { color: #2980b9; text-shadow: none; }


/* Mansion: Cyberpunk, Neon, Dark, Elite */
.theme-mansion {
    background: #050505;
    background-image: 
        linear-gradient(rgba(0, 255, 255, 0.05) 1px, transparent 1px),
        linear-gradient(90deg, rgba(0, 255, 255, 0.05) 1px, transparent 1px);
    background-size: 30px 30px;
    border: 2px solid #00f3ff;
    box-shadow: 0 0 30px rgba(0, 243, 255, 0.3), inset 0 0 50px rgba(0,0,0,0.8);
}
.theme-mansion .glass-panel {
    background: rgba(10, 10, 18, 0.8);
    border: 1px solid rgba(0, 243, 255, 0.3);
    box-shadow: 0 0 15px rgba(0, 243, 255, 0.1);
    color: #fff;
}
.theme-mansion .section-header h3 {
    text-transform: uppercase;
    letter-spacing: 1px;
    text-shadow: 0 0 10px rgba(0, 243, 255, 0.5);
}
.theme-mansion .money-text { color: #00f3ff; text-shadow: 0 0 10px #00f3ff; }


/* Palace: Gold, Royal, Opulent */
.theme-palace {
    background: radial-gradient(circle, #4a0000 0%, #2a0000 100%); /* Royal Red/Black */
    border: 8px double #ffd700;
    box-shadow: 0 0 50px rgba(255, 215, 0, 0.3);
}
.theme-palace::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background-image: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffd700' fill-opacity='0.05'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
    pointer-events: none;
}
.theme-palace .glass-panel {
    background: rgba(40, 0, 0, 0.8);
    border: 2px solid #ffd700;
    border-radius: 8px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
    color: #ffd700;
}
.theme-palace .section-header h3 {
    font-family: 'Times New Roman', Times, serif;
    font-style: italic;
    letter-spacing: 1px;
    background: linear-gradient(to bottom, #ffd700, #bf953f);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    text-shadow: none;
}
.theme-palace .money-text { color: #ffd700; text-shadow: 0 0 10px #ffd700; }
.theme-palace .btn-glow {
    background: linear-gradient(to bottom, #ffd700, #bf953f);
    color: #2a0000;
    border: 1px solid #fff;
    font-weight: 900;
}


