/* Masarak Theme - Main Styles */

/* ===== HEADER ===== */
.masarak-header {
    background: white;
    box-shadow: 0 2px 10px rgba(0,0,0,0.08);
    position: sticky;
    top: 0;
    z-index: 1000;
}
.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 20px;
    gap: 20px;
}
.logo-text {
    display: flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    color: var(--primary);
}
.logo-icon { font-size: 28px; }
.logo-name  { font-size: 22px; font-weight: 900; color: var(--primary); }

.header-nav ul { display: flex; gap: 5px; list-style: none; flex-direction: row-reverse; }
.header-nav ul li a {
    display: block;
    padding: 8px 14px;
    border-radius: 8px;
    color: var(--text);
    font-weight: 600;
    font-size: 14px;
    transition: all 0.2s;
}
.header-nav ul li a:hover { background: var(--light); color: var(--primary); }
.header-nav ul li.nav-highlight a { background: var(--primary); color: white; }
.header-nav ul li.nav-highlight a:hover { background: var(--accent); }

/* Dropdown nav */
.nav-dropdown-wrap { position: relative; }
.nav-dropdown-toggle { display: flex !important; align-items: center; gap: 4px; cursor: pointer; }
.nav-dropdown { display: none !important; position: absolute; top: calc(100% + 4px); right: 0; min-width: 190px; background: white; border-radius: 12px; box-shadow: 0 8px 25px rgba(0,0,0,0.13); padding: 8px; z-index: 999; flex-direction: column !important; gap: 2px !important; list-style: none !important; }
.nav-dropdown li a { white-space: nowrap; border-radius: 8px; display: block; padding: 9px 14px; }
.nav-dropdown-wrap:hover .nav-dropdown,
.nav-dropdown-wrap:focus-within .nav-dropdown { display: flex; }

.header-actions { display: flex; align-items: center; gap: 10px; }
.header-streak {
    display: flex;
    align-items: center;
    gap: 4px;
    font-weight: 700;
    font-size: 15px;
    color: #e74c3c;
    text-decoration: none;
    padding: 6px 12px;
    background: #fff5f5;
    border-radius: 20px;
    border: 1px solid #ffd5d5;
}

.header-user-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--light);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 6px 12px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    color: var(--text);
    font-family: 'Tajawal', sans-serif;
}
.header-avatar { border-radius: 50%; }
.header-user-menu { position: relative; }
.user-dropdown {
    display: none;
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    background: white;
    border: 1px solid var(--border);
    border-radius: 10px;
    box-shadow: 0 8px 25px rgba(0,0,0,0.12);
    min-width: 200px;
    overflow: hidden;
    z-index: 1001;
}
.header-user-menu:hover .user-dropdown { display: block; }
.user-dropdown-header { padding: 15px; background: var(--light); border-bottom: 1px solid var(--border); }
.user-dropdown a {
    display: block;
    padding: 10px 15px;
    color: var(--text);
    font-size: 14px;
    transition: background 0.2s;
}
.user-dropdown a:hover { background: var(--light); }
.user-dropdown .logout-link { color: #e74c3c; border-top: 1px solid var(--border); }

.mobile-menu-btn { display: none; background: none; border: none; font-size: 22px; cursor: pointer; }

/* ===== HERO SLIDER ===== */
.masarak-hero-slider {
    position: relative;
    height: 520px;
    overflow: hidden;
}
.slider-track { position: relative; height: 100%; }
.slide {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: linear-gradient(135deg, var(--primary) 0%, var(--accent) 100%);
    background-size: cover;
    background-position: center;
    display: flex;
    align-items: center;
    opacity: 0;
    transition: opacity 0.6s ease;
}
.slide.active { opacity: 1; z-index: 1; }
.slide-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(27,79,114,0.88) 0%, rgba(46,134,193,0.75) 100%);
}
.slide-content {
    position: relative;
    z-index: 2;
    color: white;
    max-width: 700px;
}
.slide-badge {
    display: inline-block;
    background: rgba(255,255,255,0.2);
    padding: 6px 16px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 20px;
}
.slide-content h1 { font-size: 38px; font-weight: 900; margin-bottom: 15px; line-height: 1.3; }
.slide-content p  { font-size: 16px; opacity: 0.9; margin-bottom: 25px; line-height: 1.7; }
.slide-actions { display: flex; gap: 15px; flex-wrap: wrap; }
.slider-prev, .slider-next {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255,255,255,0.2);
    border: 2px solid rgba(255,255,255,0.4);
    color: white;
    width: 45px; height: 45px;
    border-radius: 50%;
    font-size: 22px;
    cursor: pointer;
    z-index: 3;
    transition: background 0.2s;
    line-height: 1;
}
.slider-prev:hover, .slider-next:hover { background: rgba(255,255,255,0.35); }
.slider-prev { right: 20px; }
.slider-next { left: 20px; }
.slider-dots { position: absolute; bottom: 20px; left: 50%; transform: translateX(-50%); display: flex; gap: 8px; z-index: 3; }
.slider-dot {
    width: 10px; height: 10px;
    border-radius: 50%;
    background: rgba(255,255,255,0.5);
    cursor: pointer;
    transition: background 0.2s, transform 0.2s;
}
.slider-dot.active { background: white; transform: scale(1.3); }

/* ===== STATS BAR ===== */
.stats-bar { background: var(--primary); color: white; padding: 20px 0; }
.stats-grid { display: flex; justify-content: space-around; flex-wrap: wrap; gap: 15px; }
.stat-item { text-align: center; }
.stat-number { display: block; font-size: 28px; font-weight: 900; }
.stat-label  { font-size: 13px; opacity: 0.85; }

/* ===== DAILY CHALLENGE ===== */
.daily-challenge-section { padding: 30px 0; }
.daily-challenge-card {
    background: linear-gradient(135deg, #fff9ec, #fff3d4);
    border: 2px solid #f7c59f;
    border-radius: 16px;
    padding: 30px 35px;
    display: flex;
    align-items: center;
    gap: 30px;
}
.dc-right { text-align: center; min-width: 100px; }
.dc-fire  { font-size: 40px; }
.dc-center { flex: 1; }
.dc-center h2 { font-size: 20px; font-weight: 700; color: var(--primary); margin-bottom: 8px; }
.dc-center p  { color: var(--muted); font-size: 14px; margin-bottom: 15px; }
.dc-xp-bar { max-width: 400px; }

/* ===== GUEST CTA ===== */
.guest-cta-section { padding: 30px 0; }
.guest-cta-card {
    background: linear-gradient(135deg, var(--primary), var(--accent));
    color: white;
    border-radius: 16px;
    padding: 35px 40px;
    display: flex;
    align-items: center;
    gap: 40px;
}
.cta-left { flex: 1; }
.cta-left h2 { font-size: 24px; font-weight: 900; margin-bottom: 10px; }
.cta-left p  { opacity: 0.9; font-size: 15px; }
.cta-features { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
.cta-feature-item { font-size: 13px; opacity: 0.9; }

/* ===== EXPLORE SECTION ===== */
.explore-section { padding: 70px 0; }
.explore-card { text-decoration: none; }
.explore-emoji {
    width: 70px; height: 70px;
    border-radius: 16px;
    display: flex; align-items: center; justify-content: center;
    font-size: 32px;
    margin: 0 auto 15px;
}
.explore-arrow { font-size: 13px; font-weight: 600; margin-top: 15px; }

/* ===== RECENT SECTIONS ===== */
.recent-section { padding: 60px 0; }
.articles-section { padding: 60px 0; }
.uni-card { text-decoration: none; }

/* ===== FINAL CTA ===== */
.final-cta { background: linear-gradient(135deg, var(--primary), var(--accent)); padding: 70px 0; }
.final-cta-inner { text-align: center; color: white; }
.final-cta-inner h2 { font-size: 32px; font-weight: 900; margin-bottom: 15px; }
.final-cta-inner p  { font-size: 16px; opacity: 0.9; margin-bottom: 30px; }

/* ===== FOOTER ===== */
.masarak-footer { background: #1a2a3a; color: #bdc3c7; padding: 60px 0 0; }
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 40px; }
.footer-logo { font-size: 22px; font-weight: 900; color: white; margin-bottom: 15px; }
.footer-about p { font-size: 14px; line-height: 1.7; margin-bottom: 15px; }
.footer-socials a { font-size: 20px; margin-left: 10px; text-decoration: none; }
.footer-col h4 { color: white; font-size: 15px; font-weight: 700; margin-bottom: 15px; }
.footer-col ul { list-style: none; }
.footer-col ul li { margin-bottom: 8px; font-size: 14px; }
.footer-col ul li a { color: #bdc3c7; transition: color 0.2s; }
.footer-col ul li a:hover { color: white; }
.footer-bottom {
    display: flex;
    justify-content: space-between;
    padding: 20px 0;
    border-top: 1px solid rgba(255,255,255,0.1);
    margin-top: 40px;
    font-size: 13px;
    color: #7f8c8d;
}

/* ===== INNER PAGES ===== */
.masarak-archive { padding: 40px 0; }
.masarak-filters {
    background: white;
    border-radius: 10px;
    padding: 20px;
    margin-bottom: 30px;
    border: 1px solid var(--border);
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    align-items: center;
}
.masarak-filters input[type=text], .masarak-filters select {
    padding: 10px 15px;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-family: 'Tajawal', sans-serif;
    font-size: 14px;
    color: var(--text);
}
.masarak-filters input[type=text] { flex: 1; min-width: 200px; }

/* Daily quiz page */
.quiz-page { max-width: 750px; margin: 0 auto; padding: 40px 20px; }
.quiz-header { background: linear-gradient(135deg, var(--primary), var(--accent)); color: white; border-radius: 12px; padding: 25px; margin-bottom: 30px; display: flex; justify-content: space-between; align-items: center; }
.quiz-streak-badge { background: rgba(255,255,255,0.2); padding: 10px 18px; border-radius: 10px; text-align: center; }
#masarak-quiz-submit {
    width: 100%;
    padding: 15px;
    background: #ccc;
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 16px;
    font-weight: 700;
    cursor: not-allowed;
    transition: all 0.3s;
    font-family: 'Tajawal', sans-serif;
    margin-top: 20px;
}
#masarak-quiz-submit.ready { background: var(--primary); cursor: pointer; }
#masarak-quiz-submit.ready:hover { background: var(--accent); }

/* Personality test */
.test-page { max-width: 800px; margin: 0 auto; padding: 40px 20px; }
.test-progress-bar { height: 8px; background: var(--border); border-radius: 8px; margin: 15px 0; }
.test-progress-fill { height: 100%; background: linear-gradient(90deg, var(--primary), var(--accent)); border-radius: 8px; transition: width 0.3s; }
.test-question { background: white; border: 1px solid var(--border); border-radius: 12px; padding: 25px; margin-bottom: 20px; }
.test-question h4 { font-size: 16px; color: var(--text); margin-bottom: 15px; font-weight: 600; }
.scale-labels { display: flex; justify-content: space-between; font-size: 11px; color: var(--muted); margin-bottom: 8px; }
#masarak-test-submit {
    width: 100%;
    padding: 15px;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s;
    font-family: 'Tajawal', sans-serif;
    margin-top: 10px;
}
#masarak-test-submit:hover { background: var(--accent); }

/* Auth pages */
.auth-page {
    min-height: 80vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
}
.auth-card {
    background: white;
    border-radius: 16px;
    padding: 40px;
    width: 100%;
    max-width: 420px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.1);
}
.auth-card h1 { font-size: 26px; font-weight: 900; color: var(--primary); text-align: center; margin-bottom: 8px; }
.auth-card .auth-subtitle { text-align: center; color: var(--muted); margin-bottom: 30px; font-size: 14px; }
.form-group { margin-bottom: 18px; }
.form-group label { display: block; font-weight: 600; font-size: 14px; margin-bottom: 6px; color: var(--text); }
.form-group input {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid var(--border);
    border-radius: 8px;
    font-family: 'Tajawal', sans-serif;
    font-size: 14px;
    transition: border-color 0.2s;
    direction: rtl;
}
.form-group input:focus { outline: none; border-color: var(--accent); }
.auth-submit {
    width: 100%;
    padding: 13px;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.3s;
    font-family: 'Tajawal', sans-serif;
    margin-top: 5px;
}
.auth-submit:hover { background: var(--accent); }
.auth-switch { text-align: center; margin-top: 20px; font-size: 14px; color: var(--muted); }

/* Profile page */
.profile-page { padding: 40px 0; }
.profile-hero {
    background: linear-gradient(135deg, var(--primary), var(--accent));
    color: white;
    border-radius: 16px;
    padding: 35px;
    display: flex;
    align-items: center;
    gap: 25px;
    margin-bottom: 30px;
}
.profile-avatar-wrap img { width: 80px; height: 80px; border-radius: 50%; border: 3px solid white; }
.profile-info h2 { font-size: 24px; font-weight: 900; margin-bottom: 5px; }
.profile-stats-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 15px; margin-bottom: 30px; }
.profile-stat-card { background: white; border-radius: 10px; padding: 20px; text-align: center; border: 1px solid var(--border); }
.profile-stat-num  { font-size: 28px; font-weight: 900; color: var(--primary); }
.profile-stat-label{ font-size: 13px; color: var(--muted); }

/* ===== RESPONSIVE ===== */
@media (max-width: 900px) {
    .header-nav { display: none; }
    .header-nav.open { display: block; position: absolute; top: 100%; right: 0; left: 0; background: white; box-shadow: 0 5px 20px rgba(0,0,0,0.1); padding: 20px; z-index: 1000; }
    .header-nav.open ul { flex-direction: column; }
    .mobile-menu-btn { display: block; }
    .masarak-hero-slider { height: 400px; }
    .slide-content h1 { font-size: 26px; }
    .daily-challenge-card, .guest-cta-card { flex-direction: column; text-align: center; }
    .footer-grid { grid-template-columns: 1fr 1fr; gap: 25px; }
    .profile-stats-grid { grid-template-columns: repeat(2, 1fr); }
    .cta-features { grid-template-columns: 1fr; }
}
@media (max-width: 600px) {
    .masarak-hero-slider { height: 320px; }
    .slide-content h1 { font-size: 20px; }
    .stats-grid { grid-template-columns: repeat(3, 1fr); }
    .footer-grid { grid-template-columns: 1fr; }
    .footer-bottom { flex-direction: column; gap: 8px; text-align: center; }
    .profile-stats-grid { grid-template-columns: repeat(2, 1fr); }
}
