@import url('https://fonts.googleapis.com/css2?family=Tajawal:wght@300;400;500;700;800;900&display=swap');

:root {
    --primary: #1a5f4a;
    --primary-light: #2d8f6f;
    --primary-dark: #0d3a2d;
    --secondary: #f0a500;
    --gold: #d4af37;
    --gold-light: #f4d03f;
    --bg-dark: #0a1f17;
    --bg-card: #112920;
    --bg-input: #1a3830;
    --text-primary: #ffffff;
    --text-secondary: #a8d5c7;
    --text-muted: #6b9b8a;
    --success: #4caf50;
    --error: #ef5350;
    --gradient-primary: linear-gradient(135deg, #1a5f4a 0%, #2d8f6f 100%);
    --gradient-gold: linear-gradient(135deg, #d4af37 0%, #f4d03f 100%);
    --shadow-soft: 0 4px 20px rgba(0, 0, 0, 0.3);
    --shadow-glow: 0 0 30px rgba(45, 143, 111, 0.3);
}

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

html {
    font-size: 16px;
    scroll-behavior: smooth;
}

body {
    font-family: 'Tajawal', sans-serif;
    background: var(--bg-dark);
    color: var(--text-primary);
    min-height: 100vh;
    direction: rtl;
    line-height: 1.6;
    overflow-x: hidden;
}

/* Background Pattern */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: 
        radial-gradient(circle at 20% 20%, rgba(45, 143, 111, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 80% 80%, rgba(212, 175, 55, 0.05) 0%, transparent 50%);
    pointer-events: none;
    z-index: -1;
}

/* Container */
.container {
    max-width: 480px;
    margin: 0 auto;
    padding: 0 16px;
}

/* Header */
.header {
    background: linear-gradient(180deg, var(--bg-dark) 0%, transparent 100%);
    padding: 20px 0;
    position: sticky;
    top: 0;
    z-index: 100;
    backdrop-filter: blur(10px);
}

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

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
}

.logo-icon {
    width: 48px;
    height: 48px;
    background: var(--gradient-primary);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    box-shadow: var(--shadow-glow);
}

.logo-text {
    font-size: 28px;
    font-weight: 800;
    color: var(--text-primary);
    letter-spacing: -1px;
}

.nav-btn {
    padding: 10px 20px;
    background: var(--gradient-primary);
    border: none;
    border-radius: 25px;
    color: var(--text-primary);
    font-family: inherit;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
}

.nav-btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-glow);
}

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

/* Hero Section */
.hero {
    padding: 40px 0 60px;
    text-align: center;
}

.hero-badge {
    display: inline-block;
    padding: 8px 16px;
    background: rgba(45, 143, 111, 0.2);
    border: 1px solid var(--primary-light);
    border-radius: 20px;
    font-size: 12px;
    color: var(--text-secondary);
    margin-bottom: 20px;
}

.hero h1 {
    font-size: 36px;
    font-weight: 900;
    line-height: 1.2;
    margin-bottom: 16px;
    background: linear-gradient(135deg, var(--text-primary) 0%, var(--text-secondary) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero p {
    font-size: 16px;
    color: var(--text-muted);
    max-width: 300px;
    margin: 0 auto 30px;
}

.hero-stats {
    display: flex;
    justify-content: center;
    gap: 30px;
    margin-top: 30px;
}

.hero-stat {
    text-align: center;
}

.hero-stat-value {
    font-size: 28px;
    font-weight: 800;
    color: var(--gold);
}

.hero-stat-label {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 4px;
}

/* Stats Cards */
.stats-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-bottom: 24px;
}

.stat-card {
    background: var(--bg-card);
    border-radius: 16px;
    padding: 20px;
    text-align: center;
    border: 1px solid rgba(45, 143, 111, 0.2);
    transition: all 0.3s ease;
}

.stat-card:hover {
    border-color: var(--primary-light);
    transform: translateY(-2px);
}

.stat-icon {
    font-size: 32px;
    margin-bottom: 8px;
}

.stat-value {
    font-size: 24px;
    font-weight: 800;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.stat-label {
    font-size: 12px;
    color: var(--text-muted);
}

/* Leaderboard */
.section-title {
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.section-title::before {
    content: '';
    width: 4px;
    height: 24px;
    background: var(--gradient-gold);
    border-radius: 2px;
}

.leaderboard {
    background: var(--bg-card);
    border-radius: 20px;
    overflow: hidden;
    border: 1px solid rgba(45, 143, 111, 0.2);
    margin-bottom: 30px;
}

.leaderboard-header {
    background: var(--gradient-primary);
    padding: 16px 20px;
    display: grid;
    grid-template-columns: 50px 1fr 100px;
    gap: 10px;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary);
}

.leaderboard-item {
    display: grid;
    grid-template-columns: 50px 1fr 100px;
    gap: 10px;
    padding: 16px 20px;
    align-items: center;
    border-bottom: 1px solid rgba(45, 143, 111, 0.1);
    transition: all 0.3s ease;
}

.leaderboard-item:last-child {
    border-bottom: none;
}

.leaderboard-item:hover {
    background: rgba(45, 143, 111, 0.1);
}

.rank {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 14px;
}

.rank-1 {
    background: var(--gradient-gold);
    color: var(--bg-dark);
}

.rank-2 {
    background: linear-gradient(135deg, #c0c0c0 0%, #e8e8e8 100%);
    color: var(--bg-dark);
}

.rank-3 {
    background: linear-gradient(135deg, #cd7f32 0%, #e8a862 100%);
    color: var(--bg-dark);
}

.rank-other {
    background: var(--bg-input);
    color: var(--text-muted);
}

.college-name {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-primary);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.college-steps {
    font-size: 14px;
    font-weight: 700;
    color: var(--gold);
    text-align: left;
}

/* Forms */
.form-container {
    background: var(--bg-card);
    border-radius: 24px;
    padding: 32px 24px;
    border: 1px solid rgba(45, 143, 111, 0.2);
    margin: 20px 0;
}

.form-title {
    font-size: 24px;
    font-weight: 800;
    text-align: center;
    margin-bottom: 8px;
}

.form-subtitle {
    font-size: 14px;
    color: var(--text-muted);
    text-align: center;
    margin-bottom: 32px;
}

.form-group {
    margin-bottom: 20px;
}

.form-label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.form-input {
    width: 100%;
    padding: 14px 16px;
    background: var(--bg-input);
    border: 2px solid transparent;
    border-radius: 12px;
    color: var(--text-primary);
    font-family: inherit;
    font-size: 16px;
    transition: all 0.3s ease;
}

.form-input:focus {
    outline: none;
    border-color: var(--primary-light);
    box-shadow: 0 0 0 4px rgba(45, 143, 111, 0.1);
}

.form-input::placeholder {
    color: var(--text-muted);
}

.form-select {
    width: 100%;
    padding: 14px 16px;
    background: var(--bg-input);
    border: 2px solid transparent;
    border-radius: 12px;
    color: var(--text-primary);
    font-family: inherit;
    font-size: 16px;
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%236b9b8a' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: left 16px center;
    padding-left: 48px;
}

.form-select:focus {
    outline: none;
    border-color: var(--primary-light);
}

.form-select option {
    background: var(--bg-dark);
    color: var(--text-primary);
}

.checkbox-group {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 16px;
    background: rgba(212, 175, 55, 0.1);
    border: 1px solid rgba(212, 175, 55, 0.3);
    border-radius: 12px;
    margin-bottom: 24px;
}

.checkbox-input {
    width: 20px;
    height: 20px;
    margin-top: 2px;
    accent-color: var(--gold);
    cursor: pointer;
}

.checkbox-label {
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.5;
}

.btn {
    width: 100%;
    padding: 16px 24px;
    background: var(--gradient-primary);
    border: none;
    border-radius: 12px;
    color: var(--text-primary);
    font-family: inherit;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-glow);
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.btn-gold {
    background: var(--gradient-gold);
    color: var(--bg-dark);
}

.form-link {
    text-align: center;
    margin-top: 20px;
    font-size: 14px;
    color: var(--text-muted);
}

.form-link a {
    color: var(--primary-light);
    text-decoration: none;
    font-weight: 600;
}

.form-link a:hover {
    text-decoration: underline;
}

/* Dashboard */
.dashboard-header {
    background: var(--bg-card);
    border-radius: 20px;
    padding: 24px;
    margin-bottom: 20px;
    border: 1px solid rgba(45, 143, 111, 0.2);
}

.user-info {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 20px;
}

.user-avatar {
    width: 60px;
    height: 60px;
    background: var(--gradient-primary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    font-weight: 800;
}

.user-details h2 {
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 4px;
}

.user-details p {
    font-size: 13px;
    color: var(--text-muted);
}

.user-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
}

.user-stat {
    text-align: center;
    padding: 12px;
    background: var(--bg-input);
    border-radius: 12px;
}

.user-stat-value {
    font-size: 20px;
    font-weight: 800;
    color: var(--gold);
}

.user-stat-label {
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 2px;
}

/* Add Steps Form */
.add-steps-section {
    background: var(--bg-card);
    border-radius: 20px;
    padding: 24px;
    border: 1px solid rgba(45, 143, 111, 0.2);
    margin-bottom: 20px;
}

.file-upload {
    position: relative;
    width: 100%;
    height: 150px;
    border: 2px dashed var(--primary-light);
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    overflow: hidden;
}

.file-upload:hover {
    background: rgba(45, 143, 111, 0.1);
}

.file-upload input {
    position: absolute;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
}

.file-upload-icon {
    font-size: 40px;
    margin-bottom: 8px;
}

.file-upload-text {
    font-size: 14px;
    color: var(--text-muted);
}

.file-upload.has-file {
    border-style: solid;
    border-color: var(--success);
}

.file-preview {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Steps History */
.steps-history {
    background: var(--bg-card);
    border-radius: 20px;
    padding: 24px;
    border: 1px solid rgba(45, 143, 111, 0.2);
}

.steps-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 0;
    border-bottom: 1px solid rgba(45, 143, 111, 0.1);
}

.steps-item:last-child {
    border-bottom: none;
}

.steps-date {
    font-size: 14px;
    color: var(--text-muted);
}

.steps-count {
    font-size: 18px;
    font-weight: 700;
    color: var(--gold);
}

/* About Page */
.about-hero {
    padding: 60px 0;
    text-align: center;
}

.about-hero h1 {
    font-size: 32px;
    font-weight: 900;
    margin-bottom: 16px;
}

.about-hero p {
    font-size: 16px;
    color: var(--text-muted);
    max-width: 320px;
    margin: 0 auto;
}

.about-section {
    background: var(--bg-card);
    border-radius: 20px;
    padding: 24px;
    margin-bottom: 20px;
    border: 1px solid rgba(45, 143, 111, 0.2);
}

.about-section h2 {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.about-section p {
    font-size: 14px;
    color: var(--text-secondary);
    line-height: 1.8;
}

.team-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.team-card {
    background: var(--bg-input);
    border-radius: 16px;
    padding: 20px;
    text-align: center;
    transition: all 0.3s ease;
}

.team-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-soft);
}

.team-avatar {
    width: 64px;
    height: 64px;
    background: var(--gradient-primary);
    border-radius: 50%;
    margin: 0 auto 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    font-weight: 800;
}

.team-name {
    font-size: 14px;
    font-weight: 700;
    margin-bottom: 4px;
}

.team-role {
    font-size: 11px;
    color: var(--gold);
    margin-bottom: 4px;
}

.team-dept {
    font-size: 11px;
    color: var(--text-muted);
}

/* Alert Messages */
.alert {
    padding: 14px 16px;
    border-radius: 12px;
    font-size: 14px;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.alert-success {
    background: rgba(76, 175, 80, 0.2);
    border: 1px solid var(--success);
    color: var(--success);
}

.alert-error {
    background: rgba(239, 83, 80, 0.2);
    border: 1px solid var(--error);
    color: var(--error);
}

.alert-warning {
    background: rgba(255, 152, 0, 0.2);
    border: 1px solid #ff9800;
    color: #ffb74d;
}

/* Success Modal */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.modal-content {
    background: var(--bg-card);
    border-radius: 24px;
    padding: 40px 32px;
    text-align: center;
    max-width: 340px;
    width: 90%;
    border: 1px solid rgba(45, 143, 111, 0.3);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    transform: scale(0.8);
    transition: transform 0.3s ease;
}

.modal-overlay.active .modal-content {
    transform: scale(1);
}

.modal-icon {
    font-size: 64px;
    margin-bottom: 16px;
}

.modal-title {
    font-size: 22px;
    font-weight: 800;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.modal-message {
    font-size: 14px;
    color: var(--text-muted);
    margin-bottom: 24px;
    line-height: 1.6;
}

.modal-steps {
    font-size: 32px;
    font-weight: 900;
    color: var(--gold);
    margin-bottom: 24px;
}

.modal-btn {
    width: 100%;
    padding: 14px 24px;
    background: var(--gradient-primary);
    border: none;
    border-radius: 12px;
    color: var(--text-primary);
    font-family: inherit;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
}

.modal-btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-glow);
}

/* Loading */
.loading {
    display: flex;
    justify-content: center;
    padding: 40px;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid var(--bg-input);
    border-top-color: var(--primary-light);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Footer */
.footer {
    text-align: center;
    padding: 30px 0;
    font-size: 12px;
    color: var(--text-muted);
}

.footer a {
    color: var(--primary-light);
    text-decoration: none;
}

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

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

/* Responsive adjustments */
@media (max-width: 380px) {
    .hero h1 {
        font-size: 28px;
    }
    
    .hero-stats {
        gap: 20px;
    }
    
    .leaderboard-header,
    .leaderboard-item {
        grid-template-columns: 40px 1fr 80px;
        padding: 12px 16px;
    }
    
    .college-steps {
        font-size: 12px;
    }
}

/* Logout Button */
.logout-btn {
    background: transparent;
    border: 1px solid var(--error);
    color: var(--error);
    padding: 8px 16px;
    border-radius: 8px;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.logout-btn:hover {
    background: var(--error);
    color: white;
}

/* Menu Navigation */
.nav-menu {
    display: flex;
    gap: 8px;
    align-items: center;
}
