/* Joy Space - Main Stylesheet */

:root {
    --primary-color: #f59e0b;
    --secondary-color: #f97316;
    --success-color: #10b981;
    --warning-color: #dc2626;
    --danger-color: #ef4444;
    --dark-bg: #1f2937;
    --light-bg: #fffbeb;
    --text-primary: #111827;
    --text-secondary: #6b7280;
    --border-color: #e5e7eb;
}

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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: var(--text-primary);
    background-color: #fff;
}

/* Navigation */
/* Navbar Base Styles */
.navbar {
    background-color: white;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    padding: 1rem 0;
    position: sticky;
    top: 0;
    z-index: 1000;
}

.navbar-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative;
}

.navbar-logo {
    font-size: 1.5rem;
    font-weight: bold;
    color: var(--primary-color);
    text-decoration: none;
    z-index: 1002;
}

.navbar-menu {
    display: flex;
    list-style: none;
    gap: 2rem;
    align-items: center;
    margin: 0;
    padding: 0;
}

.navbar-menu li {
    margin: 0;
}

.navbar-menu a {
    text-decoration: none;
    color: var(--text-primary);
    font-weight: 500;
    transition: color 0.3s;
    display: inline-block;
}

.navbar-menu a:hover {
    color: var(--primary-color);
}

.navbar-menu .btn {
    padding: 0.5rem 1.5rem;
    background-color: var(--primary-color);
    color: white;
    border-radius: 0.5rem;
    border: none;
    cursor: pointer;
    transition: background-color 0.3s;
    text-decoration: none;
    display: inline-block;
}

.navbar-menu .btn:hover {
    background-color: var(--secondary-color);
    color: white;
}

/* Language Switcher */
.language-switcher {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.lang-btn {
    padding: 0.3rem 0.8rem;
    border: 1px solid var(--primary-color);
    border-radius: 0.3rem;
    font-size: 0.9rem;
    transition: all 0.3s;
}

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

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

/* Hamburger Menu Button */
.hamburger {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
    z-index: 1002;
    transition: all 0.3s ease;
}

.hamburger-line {
    width: 28px;
    height: 3px;
    background-color: var(--primary-color);
    transition: all 0.3s ease;
    border-radius: 2px;
}

.hamburger.active .hamburger-line:nth-child(1) {
    transform: rotate(45deg) translate(8px, 8px);
}

.hamburger.active .hamburger-line:nth-child(2) {
    opacity: 0;
}

.hamburger.active .hamburger-line:nth-child(3) {
    transform: rotate(-45deg) translate(7px, -7px);
}

/* Tablet Styles */
@media (max-width: 1024px) {
    .navbar-container {
        padding: 0 1.5rem;
    }
    
    .navbar-menu {
        gap: 1.5rem;
    }
}

/* Mobile Styles */
@media (max-width: 768px) {
    .hamburger {
        display: flex;
    }
    
    .navbar-container {
        padding: 0 1rem;
    }
    
    .navbar-menu {
        position: fixed;
        top: 0;
        left: -100%;
        width: 280px;
        height: 100vh;
        background: white;
        flex-direction: column;
        padding: 80px 20px 20px;
        box-shadow: 2px 0 10px rgba(0, 0, 0, 0.1);
        transition: left 0.3s ease;
        overflow-y: auto;
        z-index: 1001;
        gap: 0;
        align-items: flex-start;
    }
    
    .navbar-menu.active {
        left: 0;
    }
    
    .navbar-menu li {
        width: 100%;
        margin: 0;
        border-bottom: 1px solid #f0f0f0;
    }
    
    .navbar-menu li:last-child {
        border-bottom: none;
    }
    
    .navbar-menu a {
        display: block;
        padding: 15px 10px;
        width: 100%;
        transition: all 0.3s ease;
    }
    
    .navbar-menu a:hover {
        background: #f8f9fa;
        padding-left: 15px;
    }
    
    .navbar-menu .btn {
        width: 100%;
        text-align: center;
        margin-top: 10px;
        padding: 12px 1.5rem;
    }
    
    .language-switcher {
        width: 100%;
        padding: 15px 10px;
        gap: 10px;
        border-top: 2px solid #f0f0f0;
        margin-top: 10px;
    }
    
    .lang-btn {
        flex: 1;
        text-align: center;
        padding: 8px 12px;
    }
    
    /* Overlay for mobile menu */
    .navbar-menu.active::before {
        content: '';
        position: fixed;
        top: 0;
        left: 280px;
        width: calc(100vw - 280px);
        height: 100vh;
        background: rgba(0, 0, 0, 0.5);
        z-index: -1;
    }
}

/* Small Mobile Styles */
@media (max-width: 480px) {
    .navbar-logo {
        font-size: 1.2rem;
    }
    
    .navbar-menu {
        width: 100%;
        left: -100%;
    }
    
    .navbar-menu.active::before {
        left: 100%;
        width: 0;
    }
}

/* RTL Support */
[dir="rtl"] .navbar-menu {
    left: auto;
    right: -100%;
}

[dir="rtl"] .navbar-menu.active {
    right: 0;
    left: auto;
}

[dir="rtl"] .navbar-menu.active::before {
    left: auto;
    right: 280px;
}

[dir="rtl"] .navbar-menu a:hover {
    padding-left: 10px;
    padding-right: 15px;
}

[dir="rtl"] .hamburger.active .hamburger-line:nth-child(1) {
    transform: rotate(-45deg) translate(8px, -8px);
}

[dir="rtl"] .hamburger.active .hamburger-line:nth-child(3) {
    transform: rotate(45deg) translate(7px, 7px);
}

@media (max-width: 480px) {
    [dir="rtl"] .navbar-menu {
        right: -100%;
    }
    
    [dir="rtl"] .navbar-menu.active::before {
        right: 100%;
        left: auto;
    }
}

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

/* Hero Section */
.hero {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    color: white;
    padding: 6rem 2rem;
    text-align: center;
}

.hero h1 {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.hero p {
    font-size: 1.25rem;
    margin-bottom: 2rem;
    opacity: 0.9;
}

.hero .cta-button {
    display: inline-block;
    padding: 1rem 2rem;
    background-color: white;
    color: var(--primary-color);
    text-decoration: none;
    border-radius: 0.5rem;
    font-weight: bold;
    font-size: 1.1rem;
    transition: transform 0.3s;
}

.hero .cta-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}

/* Cards */
.cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
    margin: 3rem 0;
}

.card {
    background: white;
    border-radius: 0.5rem;
    padding: 2rem;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    transition: transform 0.3s, box-shadow 0.3s;
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 4px 16px rgba(0,0,0,0.15);
}

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

.card p {
    color: var(--text-secondary);
    line-height: 1.7;
}

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

/* Buttons */
.btn {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    background-color: var(--primary-color);
    color: white;
    text-decoration: none;
    border-radius: 0.5rem;
    border: none;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 500;
    transition: background-color 0.3s;
}

.btn:hover {
    background-color: var(--secondary-color);
}

.btn-secondary {
    background-color: var(--text-secondary);
}

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

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

.btn-outline {
    background-color: transparent;
    border: 2px solid var(--primary-color);
    color: var(--primary-color);
}

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

/* Forms */
.form-container {
    max-width: 500px;
    margin: 3rem auto;
    padding: 2rem;
    background: white;
    border-radius: 0.5rem;
    box-shadow: 0 2px 16px rgba(0,0,0,0.1);
}

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

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: var(--text-primary);
}

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: 0.5rem;
    font-size: 1rem;
    font-family: inherit;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.1);
}

/* Table */
.table-container {
    overflow-x: auto;
    margin: 2rem 0;
}

table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    border-radius: 0.5rem;
    overflow: hidden;
}

thead {
    background-color: var(--light-bg);
}

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

th {
    font-weight: 600;
    color: var(--text-primary);
}

tbody tr:hover {
    background-color: var(--light-bg);
}

/* Leaderboard */
.leaderboard-item {
    display: flex;
    align-items: center;
    padding: 1rem;
    background: white;
    border-radius: 0.5rem;
    margin-bottom: 1rem;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.leaderboard-rank {
    font-size: 1.5rem;
    font-weight: bold;
    color: var(--primary-color);
    margin-right: 1rem;
    min-width: 50px;
}

.leaderboard-avatar {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background-color: var(--light-bg);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 1rem;
    font-size: 1.5rem;
}

.leaderboard-info {
    flex: 1;
}

.leaderboard-name {
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.leaderboard-specialty {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.leaderboard-points {
    font-size: 1.25rem;
    font-weight: bold;
    color: var(--success-color);
}

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

.stat-card {
    background: white;
    padding: 1.5rem;
    border-radius: 0.5rem;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    text-align: center;
}

.stat-value {
    font-size: 2rem;
    font-weight: bold;
    color: var(--primary-color);
    margin-bottom: 0.5rem;
}

.stat-label {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

/* Badges */
.badges-container {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    margin: 1rem 0;
}

.badge-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 1rem;
    background: white;
    border-radius: 0.5rem;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    min-width: 120px;
}

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

.badge-name {
    font-weight: 600;
    font-size: 0.9rem;
    text-align: center;
}

/* Alerts */
.alert {
    padding: 1rem 1.5rem;
    border-radius: 0.5rem;
    margin-bottom: 1rem;
}

.alert-success {
    background-color: #d1fae5;
    color: #065f46;
    border-left: 4px solid var(--success-color);
}

.alert-error {
    background-color: #fee2e2;
    color: #991b1b;
    border-left: 4px solid var(--danger-color);
}

.alert-warning {
    background-color: #fef3c7;
    color: #92400e;
    border-left: 4px solid var(--warning-color);
}

.alert-info {
    background-color: #fef3c7;
    color: #92400e;
    border-left: 4px solid var(--primary-color);
}

/* Footer */
footer {
    background-color: var(--dark-bg);
    color: white;
    padding: 3rem 2rem;
    margin-top: 4rem;
}

.footer-content {
    max-width: 1200px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
}

.footer-section h3 {
    margin-bottom: 1rem;
}

.footer-section a {
    display: block;
    color: rgba(255,255,255,0.8);
    text-decoration: none;
    margin-bottom: 0.5rem;
}

.footer-section a:hover {
    color: white;
}

.footer-bottom {
    text-align: center;
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 1px solid rgba(255,255,255,0.1);
    color: rgba(255,255,255,0.6);
}

/* Responsive */
@media (max-width: 768px) {
    .navbar-menu {
        flex-direction: column;
        gap: 1rem;
    }
    
    .hero h1 {
        font-size: 2rem;
    }
    
    .hero p {
        font-size: 1rem;
    }
    
    .cards-grid {
        grid-template-columns: 1fr;
    }
}

/* Utility classes */
.text-center {
    text-align: center;
}

.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mt-4 { margin-top: 2rem; }

.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.mb-4 { margin-bottom: 2rem; }

.section-title {
    font-size: 2rem;
    margin-bottom: 2rem;
    color: var(--text-primary);
    text-align: center;
}

.divider {
    height: 1px;
    background-color: var(--border-color);
    margin: 2rem 0;
}

