@import url('https://fonts.googleapis.com/css2?family=Comic+Neue:wght@700&family=Marhey:wght@400;600;700&display=swap');

@font-face {
    font-family: 'Kalameh';
    src: url('fonts/Kalameh-Regular.woff2') format('woff2'),
         url('fonts/Kalameh-Regular.woff') format('woff');
    font-weight: normal;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Kalameh';
    src: url('fonts/Kalameh-Bold.woff2') format('woff2'),
         url('fonts/Kalameh-Bold.woff') format('woff');
    font-weight: bold;
    font-style: normal;
    font-display: swap;
}

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

/* ==========================================================================
   Global Hand-Drawn Cartoon Sketch Theme
   ========================================================================== */
body {
    font-family: 'Marhey', 'Comic Neue', 'Kalameh', sans-serif;
    background-color: #FAFDFD;
    min-height: 100vh;
    padding: 20px;
    direction: rtl;
    position: relative;
    overflow-x: hidden;
    color: #000000;
}

/* الگوی پس‌زمینه اسکچ دست‌کشیده و چاردخونه‌ای فلت (بدون گرادیان و نور) */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    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%3Cpath d='M0 39.5L40 39.5M39.5 0L39.5 40' stroke='%23000000' stroke-width='1' stroke-dasharray='2,2' opacity='0.08' fill='none'/%3E%3C/svg%3E");
    background-size: 40px 40px;
    background-repeat: repeat;
    pointer-events: none;
    z-index: 0;
}

body::after {
    display: none; /* حذف تمام هاله‌های ۳بعدی و نورانی */
}

/* ==========================================================================
   Header - Bold Linework & Hand-drawn Borders
   ========================================================================== */
.site-header {
    position: sticky;
    top: 0;
    z-index: 1000;
    background: #FFFFFF;
    border: 3.5px solid #000000;
    border-radius: 255px 15px 225px 15px/15px 225px 15px 255px;
    box-shadow: 5px 5px 0px #000000;
    padding: 10px 0;
    margin-bottom: 30px;
}

.header-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
}

.header-left {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    gap: 20px;
}

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

.logo-wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
    background: #FFFFFF;
    border: 3px solid #000000;
    border-radius: 12px;
    padding: 4px;
    box-shadow: 2px 2px 0px #000000;
}

.site-logo-img {
    height: 38px;
    width: auto;
    object-fit: contain;
    border-radius: 4px;
}

.brand-text {
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.brand-name {
    font-family: 'Inter', 'Kalameh', sans-serif;
    font-weight: 900;
    font-size: 22px;
    letter-spacing: 1px;
    color: #0E5E6F;
    -webkit-text-stroke: 1px #000000;
    line-height: 1.1;
}

.brand-sub {
    font-family: 'Kalameh', sans-serif;
    font-size: 12px;
    color: #000000;
    font-weight: bold;
}

.btn-back-home {
    display: inline-block;
    padding: 8px 16px;
    background: #FFFFFF;
    border: 3px solid #000000;
    border-radius: 10px;
    color: #000000;
    text-decoration: none;
    font-family: 'Kalameh', sans-serif;
    font-size: 13px;
    font-weight: bold;
    box-shadow: 3px 3px 0px #000000;
    transition: transform 0.15s ease, box-shadow 0.15s ease, background-color 0.15s ease;
    white-space: nowrap;
    position: relative;
}

.btn-back-home:hover {
    background: #0E5E6F;
    color: #FFFFFF;
    transform: translate(-2px, -2px);
    box-shadow: 5px 5px 0px #000000;
}

.btn-back-home:active {
    transform: translate(0, 0);
    box-shadow: 2px 2px 0px #000000;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 15px;
    flex-wrap: wrap;
}

/* دکمه‌های ورود و ثبت نام فلت دست‌کشیده */
.auth-buttons {
    display: flex;
    align-items: center;
    gap: 10px;
}

.btn-auth {
    display: inline-block;
    text-decoration: none;
    font-family: 'Kalameh', sans-serif;
    font-size: 14px;
    font-weight: bold;
    border: 3px solid #000000;
    border-radius: 10px;
    cursor: pointer;
    white-space: nowrap;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.btn-login {
    background: #0E5E6F;
    color: #FFFFFF;
    padding: 8px 18px;
    box-shadow: 3px 3px 0px #000000;
}

.btn-login:hover {
    transform: translate(-2px, -2px);
    box-shadow: 5px 5px 0px #000000;
}

.btn-login:active {
    transform: translate(0, 0);
    box-shadow: 1px 1px 0px #000000;
}

.btn-register {
    background: #FFFFFF;
    color: #000000;
    padding: 8px 18px;
    box-shadow: 3px 3px 0px #000000;
}

.btn-register:hover {
    background: #F0F7F8;
    transform: translate(-2px, -2px);
    box-shadow: 5px 5px 0px #000000;
}

.btn-register:active {
    transform: translate(0, 0);
    box-shadow: 1px 1px 0px #000000;
}

/* User Info Card in Header */
.user-menu-wrapper {
    position: relative;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 6px 14px;
    background: #FFFFFF;
    border: 3px solid #000000;
    border-radius: 20px;
    box-shadow: 3px 3px 0px #000000;
    cursor: pointer;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.user-info:hover {
    transform: translate(-2px, -2px);
    box-shadow: 5px 5px 0px #000000;
}

.user-details {
    display: flex;
    flex-direction: column;
}

.user-name {
    font-weight: bold;
    font-size: 14px;
    color: #000000;
    line-height: 1.2;
}

.user-email {
    font-size: 11px;
    color: #444444;
    line-height: 1.2;
}

.user-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: #0E5E6F;
    color: #FFFFFF;
    border: 2px solid #000000;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 900;
    font-size: 16px;
    flex-shrink: 0;
}

/* User Dropdown Menu */
.user-menu {
    position: absolute;
    top: calc(100% + 12px);
    left: 0;
    background: #FFFFFF;
    border: 3.5px solid #000000;
    border-radius: 14px;
    box-shadow: 6px 6px 0px #000000;
    min-width: 220px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.2s ease;
    z-index: 1001;
    padding: 8px;
}

.user-menu.active {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.user-menu .menu-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    text-decoration: none;
    color: #000000;
    font-family: 'Kalameh', sans-serif;
    font-size: 14px;
    font-weight: bold;
    border: 2px solid transparent;
    border-radius: 8px;
    transition: all 0.15s ease;
}

.user-menu .menu-item:hover {
    background: #F0F7F8;
    border-color: #000000;
    transform: translateX(-4px);
}

.menu-item-icon {
    font-size: 18px;
    width: 24px;
    text-align: center;
}

/* ==========================================================================
   Hero Section
   ========================================================================== */
.menu-container {
    max-width: 1000px;
    margin: 0 auto;
    padding: 30px 20px;
    position: relative;
    z-index: 1;
}

.menu-header {
    text-align: center;
    margin-bottom: 45px;
}

.hero-logo-box {
    margin: 0 auto 20px auto;
    display: inline-block;
    padding: 12px;
    background: #FFFFFF;
    border: 3.5px solid #000000;
    border-radius: 255px 15px 225px 15px/15px 225px 15px 255px;
    box-shadow: 6px 6px 0px #000000;
    position: relative;
}

/* Corner Hatching lines beside Q box */
.hero-logo-box::before {
    content: '';
    position: absolute;
    top: -8px;
    left: -8px;
    width: 20px;
    height: 4px;
    background: #000000;
    transform: rotate(-45deg);
    border-radius: 2px;
}

.hero-logo-box::after {
    content: '';
    position: absolute;
    bottom: -8px;
    right: -8px;
    width: 20px;
    height: 4px;
    background: #000000;
    transform: rotate(-45deg);
    border-radius: 2px;
}

.hero-logo-img {
    max-width: 130px;
    height: auto;
    display: block;
}

.hero-title {
    font-family: 'Kalameh', 'Inter', sans-serif;
    font-size: 42px;
    font-weight: 900;
    color: #0E5E6F;
    -webkit-text-stroke: 1.5px #000000;
    text-shadow: 3px 3px 0px #000000;
    margin-bottom: 10px;
    letter-spacing: 1px;
}

.hero-subtitle {
    font-size: 18px;
    color: #000000;
    font-weight: bold;
    background: #FFFFFF;
    display: inline-block;
    padding: 6px 18px;
    border: 2.5px solid #000000;
    border-radius: 20px;
    box-shadow: 3px 3px 0px #000000;
}

.menu-header h1 {
    font-family: 'Kalameh', sans-serif;
    font-weight: 900;
    font-size: 38px;
    color: #0E5E6F;
    -webkit-text-stroke: 1px #000000;
    margin-bottom: 10px;
}

.menu-header p {
    font-size: 18px;
    color: #000000;
    font-weight: bold;
}

/* ==========================================================================
   Navigation Grid & Cards
   ========================================================================== */
.menu-grid,
.menu-items {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 30px;
    margin-top: 30px;
}

.menu-card,
.menu-item {
    background: #FFFFFF;
    border: 3.5px solid #000000;
    border-radius: 255px 15px 225px 15px/15px 225px 15px 255px;
    padding: 28px;
    text-decoration: none;
    color: inherit;
    display: flex;
    align-items: center;
    gap: 20px;
    box-shadow: 6px 6px 0px #000000;
    transition: transform 0.15s ease, box-shadow 0.15s ease, background-color 0.15s ease;
    position: relative;
    cursor: pointer;
}

/* Corner Hatching Accents on Cards */
.menu-card::before,
.menu-item::before {
    content: '';
    position: absolute;
    top: 10px;
    right: 12px;
    width: 14px;
    height: 3px;
    background: #000000;
    transform: rotate(-35deg);
}

.menu-card::after,
.menu-item::after {
    content: '';
    position: absolute;
    top: 16px;
    right: 12px;
    width: 10px;
    height: 3px;
    background: #000000;
    transform: rotate(-35deg);
}

.menu-card:hover,
.menu-item:hover {
    transform: translate(-4px, -4px);
    box-shadow: 10px 10px 0px #000000;
    background-color: #FAFDFD;
}

.menu-card:active,
.menu-item:active {
    transform: translate(0, 0);
    box-shadow: 3px 3px 0px #000000;
}

.menu-icon {
    font-size: 38px;
    width: 72px;
    height: 72px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #0E5E6F;
    color: #FFFFFF;
    border: 3px solid #000000;
    border-radius: 16px;
    flex-shrink: 0;
    box-shadow: 3px 3px 0px #000000;
    position: relative;
}

.menu-content {
    flex: 1;
}

.menu-content h2 {
    font-family: 'Kalameh', sans-serif;
    font-weight: 900;
    font-size: 22px;
    color: #000000;
    margin-bottom: 6px;
}

.menu-content p {
    font-size: 14px;
    color: #333333;
    line-height: 1.5;
    font-weight: bold;
}

.menu-arrow {
    font-size: 24px;
    color: #000000;
    flex-shrink: 0;
    font-weight: 900;
    transition: transform 0.15s ease;
}

.menu-card:hover .menu-arrow,
.menu-item:hover .menu-arrow {
    transform: translateX(-6px);
}

/* ==========================================================================
   Ad Banner Box
   ========================================================================== */
.ad-container {
    margin-bottom: 35px;
    display: flex;
    justify-content: center;
}

.ad-box {
    width: 100%;
    max-width: 900px;
    height: 120px;
    background: #FFFFFF;
    border: 3.5px solid #000000;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 6px 6px 0px #000000;
    position: relative;
}

.ad-box::before {
    content: '';
    position: absolute;
    top: 8px;
    left: 10px;
    width: 16px;
    height: 3px;
    background: #000000;
    transform: rotate(45deg);
}

.ad-placeholder {
    font-family: 'Kalameh', sans-serif;
    font-weight: 900;
    color: #0E5E6F;
    font-size: 18px;
    text-align: center;
}

/* Capsule buttons redesign */
.btn-capsule {
    display: inline-block;
    padding: 6px 16px;
    color: #000000;
    background: #FFFFFF;
    text-decoration: none;
    border-radius: 20px;
    font-size: 13px;
    font-weight: bold;
    font-family: 'Kalameh', sans-serif;
    border: 2.5px solid #000000;
    box-shadow: 3px 3px 0px #000000;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.btn-capsule:hover {
    transform: translate(-2px, -2px);
    box-shadow: 5px 5px 0px #000000;
}

/* ==========================================================================
   Ultra-Clean Pixel-Perfect Mobile Responsive Styles
   ========================================================================== */
@media (max-width: 768px) {
    body {
        padding: 8px 6px !important;
    }

    .site-header {
        position: sticky !important;
        top: 5px !important;
        z-index: 1000 !important;
        padding: 6px 12px !important;
        margin-bottom: 15px !important;
        border: 2.5px solid #000000 !important;
        border-radius: 14px !important;
        box-shadow: 3px 3px 0px #000000 !important;
        background: #FFFFFF !important;
    }

    .header-container {
        display: flex !important;
        flex-direction: row !important;
        justify-content: space-between !important;
        align-items: center !important;
        gap: 6px !important;
        padding: 0 !important;
        flex-wrap: nowrap !important;
        width: 100% !important;
    }

    .header-left {
        display: flex !important;
        flex-direction: row !important;
        align-items: center !important;
        gap: 6px !important;
        width: auto !important;
        flex-shrink: 0 !important;
    }

    .logo-link {
        display: flex !important;
        align-items: center !important;
        gap: 6px !important;
    }

    .logo-wrapper {
        padding: 2px !important;
        border-width: 2px !important;
        border-radius: 8px !important;
        box-shadow: 1.5px 1.5px 0px #000000 !important;
        display: flex !important;
        align-items: center !important;
    }

    .site-logo-img {
        height: 26px !important;
        width: auto !important;
    }

    .brand-text {
        display: flex !important;
        flex-direction: column !important;
        justify-content: center !important;
    }

    .brand-name {
        font-size: 15px !important;
        line-height: 1 !important;
        -webkit-text-stroke: 0.5px #000000 !important;
    }

    .brand-sub {
        font-size: 9px !important;
        line-height: 1 !important;
        margin-top: 2px !important;
    }

    .header-right {
        display: flex !important;
        align-items: center !important;
        gap: 6px !important;
        width: auto !important;
        justify-content: flex-end !important;
        flex-wrap: nowrap !important;
    }

    .auth-buttons {
        display: flex !important;
        flex-direction: row !important;
        align-items: center !important;
        gap: 6px !important;
        flex-wrap: nowrap !important;
    }

    .btn-auth {
        padding: 5px 10px !important;
        font-size: 12px !important;
        border-width: 2px !important;
        border-radius: 8px !important;
        box-shadow: 2px 2px 0px #000000 !important;
        white-space: nowrap !important;
    }

    .btn-back-home {
        padding: 4px 8px !important;
        font-size: 11px !important;
        border-width: 2px !important;
        box-shadow: 2px 2px 0px #000000 !important;
    }

    /* Hero Section Mobile */
    .menu-container {
        margin: 10px auto !important;
        padding: 5px 2px !important;
    }

    .hero-logo-box {
        width: 80px !important;
        height: 80px !important;
        margin-bottom: 10px !important;
        border-width: 3px !important;
        border-radius: 16px !important;
        box-shadow: 3.5px 3.5px 0px #000000 !important;
    }

    .hero-logo-img {
        height: 44px !important;
    }

    .hero-title {
        font-size: 22px !important;
        margin-bottom: 6px !important;
        -webkit-text-stroke: 1px #000000 !important;
        text-shadow: 2px 2px 0px #000000 !important;
    }

    .hero-subtitle {
        font-size: 12px !important;
        padding: 5px 12px !important;
        margin-bottom: 12px !important;
        border-width: 2.5px !important;
        border-radius: 12px !important;
    }

    /* Menu & Feature Cards Mobile */
    .menu-header {
        margin-bottom: 18px !important;
    }

    .menu-header h1 {
        font-size: 22px !important;
        -webkit-text-stroke: 1px #000000 !important;
    }

    .menu-header p {
        font-size: 13px !important;
    }

    .menu-grid,
    .quizzes-grid,
    .features-grid,
    .stats-grid {
        grid-template-columns: 1fr !important;
        gap: 12px !important;
        margin-top: 15px !important;
    }

    .menu-card,
    .menu-item {
        padding: 16px 14px !important;
        border-width: 3px !important;
        border-radius: 16px !important;
        box-shadow: 4px 4px 0px #000000 !important;
    }

    .menu-card-icon {
        width: 50px !important;
        height: 50px !important;
        font-size: 26px !important;
        margin-bottom: 10px !important;
        border-width: 2.5px !important;
        border-radius: 12px !important;
    }

    .menu-card-title {
        font-size: 18px !important;
        margin-bottom: 6px !important;
    }

    .menu-card-description {
        font-size: 13px !important;
    }

    .ad-box {
        height: 80px !important;
        padding: 8px !important;
        border-width: 3px !important;
    }

    .ad-placeholder {
        font-size: 13px !important;
    }

    /* Chips / Product Categories */
    .category-chips-wrapper {
        display: flex !important;
        overflow-x: auto !important;
        white-space: nowrap !important;
        gap: 6px !important;
        padding: 4px 0 10px 0 !important;
        -webkit-overflow-scrolling: touch !important;
        scrollbar-width: none !important;
    }

    .category-chips-wrapper::-webkit-scrollbar {
        display: none !important;
    }

    .chip-item {
        flex-shrink: 0 !important;
        padding: 5px 12px !important;
        font-size: 12px !important;
    }
}

@media (max-width: 400px) {
    .brand-sub {
        display: none !important;
    }

    .brand-name {
        font-size: 13px !important;
    }

    .btn-auth {
        padding: 4px 8px !important;
        font-size: 11px !important;
    }

    .hero-title {
        font-size: 18px !important;
    }
}

/* ==========================================================================
   SSO Single Sign-On (Login with MHB) Hand-Drawn Sketch Styles
   ========================================================================== */
.sso-divider {
    display: flex;
    align-items: center;
    text-align: center;
    margin: 25px 0 20px 0;
    color: #000000;
    font-weight: bold;
    font-size: 13px;
}

.sso-divider::before,
.sso-divider::after {
    content: '';
    flex: 1;
    border-bottom: 2.5px dashed #000000;
}

.sso-divider span {
    padding: 0 12px;
}

.btn-sso-mhb {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    padding: 13px 20px;
    background: #0E5E6F;
    color: #FFFFFF !important;
    text-decoration: none !important;
    border: 3.5px solid #000000;
    border-radius: 14px;
    font-size: 16px;
    font-weight: 900;
    font-family: 'Kalameh', sans-serif;
    box-shadow: 5px 5px 0px #000000;
    cursor: pointer;
    transition: transform 0.15s ease, box-shadow 0.15s ease, background-color 0.15s ease;
    box-sizing: border-box;
}

.btn-sso-mhb:hover {
    background: #0B4A56;
    transform: translate(-2px, -2px);
    box-shadow: 7px 7px 0px #000000;
}

.btn-sso-mhb:active {
    transform: translate(2px, 2px);
    box-shadow: 2px 2px 0px #000000;
}

.sso-btn-icon {
    height: 26px;
    width: auto;
    border-radius: 5px;
    border: 1.5px solid #000000;
}

