/* Styles/main.css - تم مدرن، زیبا و امروزی پروژه روال */

/* Vazirmatn — محلی (بدون Google Fonts) */
@font-face {
    font-family: 'Vazirmatn';
    font-style: normal;
    font-weight: 400;
    font-display: swap;
    src: url('fonts/vazirmatn/vazirmatn-arabic-400-normal.woff2') format('woff2');
    unicode-range: U+0600-06FF, U+0750-077F, U+0870-088E, U+0890-0891, U+0898-08E1, U+08E3-08FF, U+200C-200E, U+2010-2011, U+204F, U+2E41, U+FB50-FDFF, U+FE70-FE74, U+FE76-FEFC;
}
@font-face {
    font-family: 'Vazirmatn';
    font-style: normal;
    font-weight: 400;
    font-display: swap;
    src: url('fonts/vazirmatn/vazirmatn-latin-400-normal.woff2') format('woff2');
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
    font-family: 'Vazirmatn';
    font-style: normal;
    font-weight: 500;
    font-display: swap;
    src: url('fonts/vazirmatn/vazirmatn-arabic-500-normal.woff2') format('woff2');
    unicode-range: U+0600-06FF, U+0750-077F, U+0870-088E, U+0890-0891, U+0898-08E1, U+08E3-08FF, U+200C-200E, U+2010-2011, U+204F, U+2E41, U+FB50-FDFF, U+FE70-FE74, U+FE76-FEFC;
}
@font-face {
    font-family: 'Vazirmatn';
    font-style: normal;
    font-weight: 500;
    font-display: swap;
    src: url('fonts/vazirmatn/vazirmatn-latin-500-normal.woff2') format('woff2');
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
    font-family: 'Vazirmatn';
    font-style: normal;
    font-weight: 600;
    font-display: swap;
    src: url('fonts/vazirmatn/vazirmatn-arabic-600-normal.woff2') format('woff2');
    unicode-range: U+0600-06FF, U+0750-077F, U+0870-088E, U+0890-0891, U+0898-08E1, U+08E3-08FF, U+200C-200E, U+2010-2011, U+204F, U+2E41, U+FB50-FDFF, U+FE70-FE74, U+FE76-FEFC;
}
@font-face {
    font-family: 'Vazirmatn';
    font-style: normal;
    font-weight: 600;
    font-display: swap;
    src: url('fonts/vazirmatn/vazirmatn-latin-600-normal.woff2') format('woff2');
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
    font-family: 'Vazirmatn';
    font-style: normal;
    font-weight: 700;
    font-display: swap;
    src: url('fonts/vazirmatn/vazirmatn-arabic-700-normal.woff2') format('woff2');
    unicode-range: U+0600-06FF, U+0750-077F, U+0870-088E, U+0890-0891, U+0898-08E1, U+08E3-08FF, U+200C-200E, U+2010-2011, U+204F, U+2E41, U+FB50-FDFF, U+FE70-FE74, U+FE76-FEFC;
}
@font-face {
    font-family: 'Vazirmatn';
    font-style: normal;
    font-weight: 700;
    font-display: swap;
    src: url('fonts/vazirmatn/vazirmatn-latin-700-normal.woff2') format('woff2');
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}




:root {
    --primary: #6366f1;
    --primary-dark: #4f46e5;
    --primary-light: #818cf8;
    --success: #10b981;
    --danger: #ef4444;
    --warning: #f59e0b;
    --gray: #6b7280;
    --light-bg: #f8fafc;
    --card-bg: #ffffff;
    --text: #1e2937;
    --text-light: #64748b;
    --border: #e2e8f0;
    --shadow: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 25px 50px -12px rgb(0 0 0 / 0.25);
}

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

/* ========== iOS / PWA Home Screen: جلوگیری از bounce و اسکرول افقی ========== */
html {
    width: 100%;
    max-width: 100%;
    height: 100%;
    overflow: hidden;              /* اسکرول فقط داخل #app */
    overscroll-behavior: none;
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
}

body {
    width: 100%;
    max-width: 100%;
    height: 100%;
    overflow: hidden;
    overscroll-behavior: none;
    position: fixed;               /* قفل rubber-band کل صفحه در iOS */
    left: 0;
    right: 0;
    top: 0;
    bottom: 0;
    /* background stays from earlier rule */
}

#app {
    width: 100%;
    max-width: 100%;
    height: 100%;
    height: 100dvh;
    overflow-x: hidden;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-y: contain;
    overscroll-behavior-x: none;
    position: relative;
}

/* جلوگیری از زوم خودکار iOS روی input (علت اصلی اسکرول افقی بعد از کیبورد) */
@supports (-webkit-touch-callout: none) {
    input,
    textarea,
    select {
        font-size: 16px !important;
    }
}

/* المان‌های عریض نتوانند صفحه را افقی کنند */
img, video, canvas, svg {
    max-width: 100%;
}

.main-content,
.container,
#page-content {
    max-width: 100%;
    overflow-x: hidden;
}

/* safe area برای ناچ آیفون */
@supports (padding: max(0px)) {
    .main-header {
        padding-top: env(safe-area-inset-top);
    }
    .main-footer {
        padding-bottom: max(16px, env(safe-area-inset-bottom));
    }
    #app {
        padding-left: env(safe-area-inset-left);
        padding-right: env(safe-area-inset-right);
    }
}


body {
    font-family: 'Vazirmatn', sans-serif;
    direction: rtl;
    background: linear-gradient(135deg, #f8fafc 0%, #e0e7ff 100%);
    color: var(--text);
    line-height: 2.0;
}

/* ========== Header (ثابت و ریسپانسیو) ========== */
.main-header {
    background: rgba(255, 255, 255, 0.96);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.06);
    position: sticky;
    top: 0;
    z-index: 1100;
    border-bottom: 1px solid var(--border);
}

.header-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 20px;
    max-width: 1480px;
    margin: 0 auto;
    min-height: 56px;
    box-sizing: border-box;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    color: inherit;
    min-width: 0;
}


.logo-img {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
    display: block;
    background: #eef2ff;
}

.logo-img.sm {
    width: 32px;
    height: 32px;
}

@media (max-width: 768px) {
    .logo-img {
        width: 34px;
        height: 34px;
    }
}

.logo-mark {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: linear-gradient(135deg, #6366f1, #7c3aed);
    color: #fff;
    font-weight: 900;
    font-size: 1.1rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.35);
}

.logo-mark.sm {
    width: 32px;
    height: 32px;
    font-size: 0.95rem;
}

.logo-text {
    display: flex;
    flex-direction: column;
    line-height: 1.15;
    min-width: 0;
}

.logo-fa {
    font-size: 1.15rem;
    font-weight: 800;
    background: linear-gradient(90deg, var(--primary), var(--primary-light));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.logo-en {
    font-size: 0.68rem;
    font-weight: 600;
    color: var(--text-light);
    letter-spacing: 0.04em;
}

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

.notification-btn {
    font-size: 1.25rem;
    background: #fff;
    border: 2px solid var(--border);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
    position: relative;
    padding: 0;
    font-family: inherit;
}

.notification-btn:hover {
    background: var(--light-bg);
    border-color: #c7d2fe;
}

.badge {
    position: absolute;
    top: -4px;
    left: -4px;
    background: var(--danger);
    color: #fff;
    font-size: 0.68rem;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    border-radius: 9999px;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 4px rgba(0,0,0,0.12);
}

.badge.is-hidden { display: none !important; }

.user-profile {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    padding: 4px 8px 4px 4px;
    border-radius: 9999px;
    transition: background 0.2s;
    max-width: 180px;
}

.user-profile:hover {
    background: var(--light-bg);
}

.user-profile img,
#user-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--primary-light);
    flex-shrink: 0;
}

.user-name {
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 110px;
}

.logout-btn {
    background: #fff;
    border: 2px solid var(--border);
    border-radius: 12px;
    padding: 8px 12px;
    cursor: pointer;
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text-light);
    font-family: inherit;
    transition: all 0.2s;
    white-space: nowrap;
}

.logout-btn:hover {
    border-color: #fecaca;
    color: #dc2626;
    background: #fef2f2;
}

/* Desktop nav */
.top-nav {
    background: rgba(255, 255, 255, 0.92);
    border-top: 1px solid var(--border);
}

.nav-container,
.top-nav .container {
    display: flex;
    gap: 6px;
    padding: 8px 16px;
    max-width: 1480px;
    margin: 0 auto;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}

.top-nav .container::-webkit-scrollbar { display: none; }

.nav-item {
    text-decoration: none;
    color: var(--text-light);
    font-weight: 600;
    padding: 8px 16px;
    border-radius: 9999px;
    transition: all 0.2s;
    white-space: nowrap;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.9rem;
}

.nav-item:hover {
    background: #eef2ff;
    color: var(--primary);
}

.nav-item.active {
    background: var(--primary);
    color: #fff;
    box-shadow: 0 6px 16px -4px rgba(99, 102, 241, 0.45);
}

/* Mobile menu button */
.mobile-menu-btn {
    display: none;
    background: #fff;
    border: 2px solid var(--border);
    border-radius: 10px;
    width: 40px;
    height: 40px;
    font-size: 1.25rem;
    cursor: pointer;
    padding: 0;
    color: var(--text);
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-family: inherit;
    line-height: 1;
}

.mobile-menu-btn:hover {
    border-color: #c7d2fe;
    color: var(--primary);
}

/* Mobile full-screen menu */
.mobile-menu {
    position: fixed !important;
    top: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: 100% !important;
    margin: 0;
    background: rgba(15, 23, 42, 0.55);
    z-index: 99990 !important;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.28s ease, visibility 0.28s ease;
}

.mobile-menu.open {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

.mobile-menu-content {
    background: #fff;
    width: min(100%, 360px);
    max-width: 100%;
    height: 100%;
    height: 100dvh;
    margin: 0;
    display: flex;
    flex-direction: column;
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    transform: translateX(105%);
    transition: transform 0.32s cubic-bezier(0.32, 0.72, 0, 1);
    box-shadow: -8px 0 30px rgba(0,0,0,0.15);
    overflow: hidden;
    z-index: 99991;
    /* در صورت نبود padding روی هدر، از بالا فاصله بگیر */
    padding-top: 0;
    box-sizing: border-box;
}

.mobile-menu.open .mobile-menu-content {
    transform: translateX(0) !important;
}

body.menu-open {
    overflow: hidden;
    touch-action: none;
}

.mobile-menu-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 16px;
    /* فاصله از ساعت / Dynamic Island آیفون */
    padding-top: max(14px, env(safe-area-inset-top, 0px));
    border-bottom: 1px solid var(--border);
    background: #f8fafc;
    flex-shrink: 0;
}

.mobile-menu-brand {
    display: flex;
    align-items: center;
    gap: 10px;
}

.mobile-menu-title {
    font-size: 1.05rem;
    font-weight: 800;
    color: var(--primary);
}

.close-mobile-btn {
    background: #fff;
    border: 2px solid var(--border);
    border-radius: 10px;
    width: 36px;
    height: 36px;
    font-size: 1.1rem;
    color: var(--text-light);
    cursor: pointer;
    line-height: 1;
    transition: all 0.2s;
    font-family: inherit;
}

.close-mobile-btn:hover {
    color: var(--danger);
    border-color: #fecaca;
}

.mobile-user-block {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px;
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
}

.mobile-user-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid #c7d2fe;
}

.mobile-user-name {
    font-weight: 800;
    font-size: 0.95rem;
    color: var(--text);
}

.mobile-profile-link {
    background: none;
    border: none;
    padding: 0;
    margin-top: 2px;
    color: var(--primary);
    font-size: 0.78rem;
    font-weight: 600;
    cursor: pointer;
    font-family: inherit;
}

.mobile-nav-items {
    display: flex;
    flex-direction: column;
    padding: 8px 0;
    overflow-y: auto;
    flex: 1;
    -webkit-overflow-scrolling: touch;
}

.mobile-nav-items .nav-item {
    padding: 14px 18px;
    font-size: 0.98rem;
    justify-content: flex-start;
    border-radius: 0;
    border-bottom: 1px solid #f1f5f9;
    color: var(--text);
    margin: 0;
}

.mobile-nav-items .nav-item:hover,
.mobile-nav-items .nav-item.active {
    background: #eef2ff;
    color: var(--primary);
    box-shadow: none;
    transform: none;
}

.mobile-menu-footer {
    padding: 12px 16px 20px;
    padding-bottom: max(20px, env(safe-area-inset-bottom, 0px));
    border-top: 1px solid var(--border);
    flex-shrink: 0;
}

.mobile-logout-btn {
    width: 100%;
    padding: 12px;
    border-radius: 12px;
    border: 2px solid #fecaca;
    background: #fef2f2;
    color: #dc2626;
    font-weight: 700;
    font-size: 0.9rem;
    cursor: pointer;
    font-family: inherit;
}

/* Header responsive */
@media (max-width: 1024px) {
    .header-container {
        padding: 10px 14px;
    }
    .nav-item {
        padding: 8px 12px;
        font-size: 0.84rem;
    }
}

@media (max-width: 768px) {
    .mobile-menu-btn {
        display: inline-flex;
    }
    .desktop-nav {
        display: none !important;
    }
    .user-name,
    .logout-btn {
        display: none !important;
    }
    .header-container {
        padding: 8px 12px;
        min-height: 52px;
    }
    .logo-mark {
        width: 32px;
        height: 32px;
        font-size: 0.95rem;
    }
    .logo-fa {
        font-size: 1rem;
    }
    .logo-en {
        font-size: 0.62rem;
    }
    .notification-btn {
        width: 36px;
        height: 36px;
        font-size: 1.1rem;
    }
    .user-profile img,
    #user-avatar {
        width: 32px;
        height: 32px;
    }
    .user-profile {
        padding: 2px;
        max-width: none;
    }
}

@media (max-width: 380px) {
    .logo-en {
        display: none;
    }
    .logo-fa {
        font-size: 0.95rem;
    }
}

/* Main Content */
/* Main Content */
.main-content {
    min-height: calc(100vh - 140px);
    padding: 32px 20px;
}

.container {
    max-width: 1480px;
    margin: 0 auto;
}

/* Dashboard Styles - Very Beautiful */
.dashboard {
    padding: 20px 0;
}

.welcome-section {
    text-align: center;
    padding: 70px 40px;
    background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 100%);
    color: white;
    border-radius: 32px;
    margin-bottom: 50px;
    box-shadow: var(--shadow-lg);
    position: relative;
    overflow: hidden;
}

    .welcome-section::before {
        content: '';
        position: absolute;
        top: -50%;
        right: -20%;
        width: 400px;
        height: 400px;
        background: rgba(255,255,255,0.15);
        border-radius: 50%;
        filter: blur(40px);
    }

    .welcome-section h1 {
        font-size: 3rem;
        margin-bottom: 16px;
        font-weight: 700;
    }

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 28px;
    margin-bottom: 60px;
}

.stat-card {
    background: var(--card-bg);
    padding: 36px 28px;
    border-radius: 28px;
    box-shadow: var(--shadow);
    text-align: center;
    transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    border: 1px solid var(--border);
}

    .stat-card:hover {
        transform: translateY(-18px) scale(1.03);
        box-shadow: var(--shadow-lg);
    }

.stat-icon {
    font-size: 3.8rem;
    margin-bottom: 20px;
    display: block;
}

.stat-card h3 {
    font-size: 3.1rem;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 8px;
}

/* Cards */
.project-card, .task-item, .log-item {
    background: var(--card-bg);
    border-radius: 24px;
    padding: 28px;
    box-shadow: var(--shadow);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    border: 1px solid var(--border);
}

/* Projects Grid Spacing */
.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(360px, 1fr));
    gap: 28px;
}

.project-card:hover, .task-item:hover {
    transform: translateY(-12px);
    box-shadow: var(--shadow-lg);
    border-color: var(--primary-light);
}

/* Progress */
.progress-bar {
    height: 10px;
    background: #e2e8f0;
    border-radius: 9999px;
    margin: 20px 0;
    overflow: hidden;
}

.progress {
    height: 100%;
    background: linear-gradient(to right, var(--primary), var(--primary-light));
    border-radius: 9999px;
    transition: width 0.6s ease;
}

/* Animations */
.animate {
    opacity: 0;
    transform: translateY(30px);
    animation: fadeUp 0.8s ease forwards;
}

@keyframes fadeUp {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Responsive Design */
@media (max-width: 1024px) {
    .header-container {
        padding: 14px 20px;
    }

    .search-bar {
        margin: 0 16px;
        max-width: 320px;
    }
}

@media (max-width: 768px) {
    .search-bar {
        display: none;
    }
    .welcome-section h1 {
        font-size: 2.3rem;
    }
    .stats-grid {
        grid-template-columns: 1fr;
    }
}

.main-footer {
    background: #1e2937;
    color: #cbd5e1;
    text-align: center;
    padding: 36px 20px;
    margin-top: 80px;
}

.footer-inner {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
}

.footer-brand strong {
    font-size: 1.2rem;
    color: white;
    display: block;
    margin-bottom: 4px;
}

.footer-brand p {
    margin: 0;
    font-size: 0.88rem;
    color: #94a3b8;
}

.main-footer .footer-links {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px 4px;
}

.main-footer a {
    color: #94a3b8;
    text-decoration: none;
    margin: 0 12px;
    font-size: 0.9rem;
    transition: color 0.3s;
}

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

/* Page Placeholder */
.page-placeholder {
    text-align: center;
    padding: 120px 40px;
    color: var(--text-light);
}
