/* ==========================================================================
   1. Fonts & Variables
   ========================================================================== */
@font-face {
    font-family: 'Vazir';
    src: url('../fonts/Vazir-Light.woff2') format('woff2');
    font-weight: 300;
    font-style: normal;
    font-display: swap;
}
@font-face {
    font-family: 'Vazir';
    /* src: url('http://10.150.251.101/screenshoti/fonts/Vazir-Regular.woff2') format('woff2'); */
        src: url('../fonts/Vazir.woff2') format('woff2');
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}
@font-face {
    font-family: 'Vazir';
    src: url('../fonts/Vazir-Bold.woff2') format('woff2');
    font-weight: 700;
    font-style: normal;
    font-display: swap;
}

:root {
    --primary-color: #16a34a;
    --primary-hover: #15803d;
    --primary-light: #dcfce7;
    --danger-color: #ef4444;
    --danger-hover: #b91c1c;
    --bg-body: #f9fafb;
    --bg-card: #ffffff;
    --text-main: #1f2937;
    --text-muted: #6b7280;
    --border-color: #e5e7eb;
    --sidebar-width: 260px;
    --transition: all 0.3s ease;
}

/* ==========================================================================
   2. Reset & Base
   ========================================================================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Vazir', sans-serif;
    font-weight: 400;
    direction: rtl;
    background-color: var(--bg-body);
    color: var(--text-main);
    line-height: 1.6;
    font-size: 14px; 
}




a {
    text-decoration: none;
    color: var(--primary-color);
    transition: var(--transition);
}

a:hover {
    color: var(--primary-hover);
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 15px;
}

/* ==========================================================================
   3. Layout & Headers
   ========================================================================== */
.site-links {
    display: flex;
    gap: 20px; /* فاصله مناسب بین لینک‌ها */
    align-items: center;
}

.site-links a {
    color: var(--text-main); /* رنگ خاکستری تیره */
    font-weight: 500;
    transition: var(--transition);
}

.site-links a:hover {
    color: var(--primary-color); /* تغییر به رنگ سبز (اصلی) هنگام هاور */
}

.site-links a.active {
    color: var(--primary-color); /* رنگ سبز دلخواه خود را اینجا قرار دهید */
    font-weight: bold;
}

 .site-header {
    background: var(--bg-card);
    height: 65px; /* تعیین ارتفاع ثابت برای هدر */
    padding: 0 20px;
    display: flex;
    align-items: center;
    border-bottom: 1px solid var(--border-color);
    position: sticky; /* ثابت ماندن هدر در بالا */
    top: 0;
    z-index: 1001; /* قرار گرفتن هدر روی سایدبار */
}

.site-header nav a { margin-right: 15px; color: var(--text-main); }
.site-header nav a:hover { color: var(--primary-color); }

.main-header {
    background-color: #ffffff;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    padding: 15px 0;
    position: sticky;
    top: 0;
    z-index: 1000;
}

.header-wrapper {
    width: 100%; 
    display: flex;
    justify-content: space-between;
    align-items: center;
 align-items: center;
} 
.logo a { display: flex; align-items: center; text-decoration: none; }
.site-logo { max-height: 40px; width: auto; object-fit: contain; }
.main-nav { 
    display: flex; 
    align-items: center; 
    gap: 15px; /* فاصله مناسب بین دکمه مشاهده سایت و خروج */
}

.main-nav a { color: var(--primary-hover); text-decoration: none; font-size: 15px; transition: color 0.2s ease; }

.site-footer {
    text-align: center; padding: 20px; color: var(--text-muted); font-size: 0.9rem;
    border-top: 1px solid var(--border-color); margin-top: 40px;
}

.site-footer p {
    font-size: 0.75rem;
}


/* Admin Sidebar Layout */
.admin-wrapper {
    display: flex;
    min-height: calc(100vh - 70px);
}
.sidebar {
    width: var(--sidebar-width);
    background-color: var(--bg-card);
    height: calc(100vh - 65px); /* کسر ارتفاع هدر از کل صفحه */
    position: fixed;
    right: 0;
    top: 65px; /* شروع سایدبار دقیقا از زیر هدر */
    border-left: 1px solid var(--border-color);
    padding: 20px 16px;
    z-index: 1000;
    transition: var(--transition);
    display: flex;
    flex-direction: column;
}
.sidebar-logo { font-size: 1.5rem; font-weight: 700; color: var(--primary-color); margin-bottom: 30px; text-align: center; }
.sidebar-menu { list-style: none; flex-grow: 1; }
.sidebar-menu li { margin-bottom: 10px; }
.sidebar-menu a { display: block; padding: 10px 14px; border-radius: 8px; color: var(--text-main); }
.sidebar-menu a:hover, .sidebar-menu a.active { background-color: var(--primary-light); color: var(--primary-color); font-weight: 700; }

.main-content {
    margin-right: var(--sidebar-width);
    width: calc(100% - var(--sidebar-width));
    min-height: 100vh;
    padding: 20px;
}


.no-sidebar .main-content {
    margin: 0 auto;
    width: 100%;
}

.mobile-header {
    display: none; justify-content: space-between; align-items: center;
    background-color: var(--bg-card); padding: 14px 16px; border-bottom: 1px solid var(--border-color); margin-bottom: 20px;
}
.menu-toggle { background: none; border: none; font-size: 1.5rem; color: var(--text-main); cursor: pointer; }
.overlay { display: none; position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.5); z-index: 999; }



/* ==========================================================================
   استایل‌های مربوط به Drawer Header
   ========================================================================== */
.menu-toggle { display: none; background: none; border: none; font-size: 1.8rem; color: var(--text-main); cursor: pointer; }
.close-menu { display: none; background: none; border: none; font-size: 2rem; color: var(--text-main); cursor: pointer; margin-bottom: 20px; align-self: flex-end; }
.menu-overlay { display: none; position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.5); z-index: 1004; }
.menu-overlay.show { display: block; }

/* تنظیمات دسکتاپ */
.nav-drawer { display: flex; justify-content: space-between; align-items: center; flex-grow: 1; margin-right: 20px; }

/* جایگزین کدهای هدر موبایل قبلی (بخش 8) */
@media (max-width: 768px) {
    .header-wrapper { flex-direction: row !important; justify-content: flex-start; gap: 15px; }
    .menu-toggle { display: block; }
    
    .nav-drawer {
        position: fixed;
        top: 0;
        right: -280px;
        width: 260px;
        height: 100vh;
        background-color: var(--bg-card);
        flex-direction: column;
        justify-content: flex-start;
        align-items: stretch;
        padding: 20px;
        box-shadow: -2px 0 10px rgba(0,0,0,0.1);
        z-index: 1005;
        transition: right 0.3s ease;
        margin-right: 0;
    }
    .nav-drawer.open { right: 0; }
    .close-menu { display: block; }

    .site-links {
        flex-direction: column; align-items: flex-start; gap: 15px;
        margin-bottom: 20px; padding-bottom: 20px; border-bottom: 1px dashed var(--border-color);
    }
    .main-nav { flex-direction: column; align-items: stretch; gap: 15px; }
    .main-nav a { text-align: right; display: block; width: 100%; }
}


/* ==========================================================================
   4. admin sidebar mobile
   ========================================================================== */

/* استایل‌های سایدبار ادمین برای موبایل */
.mobile-nav-actions { display: none; margin-top: 20px; border-top: 1px solid var(--border-color); padding-top: 20px; }

@media (max-width: 992px) {
    .site-header .desktop-nav { display: none; } /* مخفی کردن دکمه‌های هدر در سایز کوچک */
    .menu-toggle { display: block; }
    
    .admin-wrapper .sidebar {
        position: fixed;
        top: 0;
        right: -280px; /* مخفی در بیرون صفحه */
        width: 260px;
        height: 100vh;
        background-color: var(--bg-card);
        z-index: 1005;
        transition: right 0.3s ease;
        transform: none; /* لغو کدهای قبلی */
    }
    
    .admin-wrapper .sidebar.show { 
        right: 0; 
    }
    
    .mobile-nav-actions { display: block; }
    .close-menu { display: block; margin-bottom: 20px; align-self: flex-end; }
}

/* ==========================================================================
   4. Buttons & Forms
   ========================================================================== */
.btn, .btn-info, .btn-danger, .btn-back { display: inline-block; padding: 6px 12px;  border: none; border-radius: 6px; font-family: inherit; font-size: 0.9rem; cursor: pointer; text-align: center; transition: var(--transition); }
.btn { background-color: var(--primary-color); color: white; }
.btn:hover { background-color: var(--primary-hover); }
.btn-info { background-color: var(--primary-light); color: var(--primary-hover); border: 1px solid var(--primary-color); }
.btn-info:hover { background-color: var(--primary-color); color: white; }
.btn-danger { background-color: var(--danger-color); color: white; }
.btn-danger:hover { background-color: var(--danger-hover); }
.btn-back { background-color: #f3f4f6; color: var(--text-main); margin-bottom: 20px; }
.btn-back:hover { background-color: var(--border-color); }

.btn-login {
    background-color: var(--primary-color);
    color: #ffffff !important;
    padding: 8px 18px;
    border-radius: 5px;
    font-size: 14px;
    font-weight: 500;
    transition: background-color 0.2s ease;
    border: none; 
    font-family: inherit; 
}

.btn-login:hover { background-color: var(--primary-hover); }
.btn-logout { background-color: #e74c3c; color: #ffffff !important; padding: 8px 18px; border-radius: 5px; font-weight: bold; transition: background-color 0.2s ease; }
.btn-logout:hover { background-color: #c0392b; }

input[type="text"], input[type="password"], select { width: 100%;  padding: 8px 12px; border: 1px solid var(--border-color); border-radius: 6px; font-family: inherit; margin-bottom: 15px; background: var(--bg-card); transition: var(--transition); }
input:focus, select:focus { outline: none; border-color: var(--primary-color); box-shadow: 0 0 0 3px var(--primary-light); }

.add-form { background: var(--bg-card); padding: 20px; border-radius: 10px; border: 1px solid var(--border-color); margin-bottom: 30px; display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.add-form input, .add-form select { margin-bottom: 0; flex: 1; min-width: 200px; }

/* ==========================================================================
   5. Admin Tables & UI Elements
   ========================================================================== */
.admin-panel h2 { font-weight: 700; margin-bottom: 20px; }
.data-table { width: 100%; border-collapse: collapse; background: var(--bg-card); border-radius: 10px; overflow: hidden; box-shadow: 0 1px 3px rgba(0,0,0,0.05); }
.data-table th, .data-table td {     padding: 10px;  text-align: right; border-bottom: 1px solid var(--border-color); }
.data-table th { background-color: #f9fafb; font-weight: 700; color: var(--text-muted); }
.data-table tr:last-child td { border-bottom: none; }

.search-box { margin-bottom: 20px; }
.search-box input { padding: 14px; font-size: 1rem; border-radius: 8px; }

.filter-chips, .category-chips { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 16px; overflow-x: auto; padding-bottom: 10px; font-family: inherit; }
.chip { 
    display: inline-flex; /* تغییر از بلاک به اینلاین فلکس */
    align-items: center;
    justify-content: center;
    padding: 6px 16px; 
    background: white; 
    border: 1px solid var(--border-color); 
    border-radius: 50px; 
    cursor: pointer; 
    white-space: nowrap; /* جلوگیری از شکستن متن داخل تگ */
    font-size: 0.9rem; 
    font-family: inherit; 
    transition: 0.2s; 
    line-height: 1.5; /* کنترل ارتفاع یکنواخت */
}
.chip:hover, .chip.active { background: var(--primary-color); color: white; border-color: var(--primary-color); }

.section-title { margin: 16px 0 15px; text-align: right; }
.section-title h2 {
    font-size: 16px; /* کاهش از 20px */
    color: #333;
    margin: 0;
}
.search-section { margin-bottom: 12px; }
.search-section input { width: 100%; padding: 12px 15px; border: 1px solid #ddd; border-radius: 8px; font-family: inherit; }

/* ==========================================================================
   6. Grids (Products, Pages, History)
   ========================================================================== */

/* --- Product Grid --- */
.product-grid, .grid-cards {
    display: grid; gap: 15px;
   grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
   margin-top: 30px;
}
.product-card {
    background: #fff; border: 1px solid #eaeaea; border-radius: 10px; overflow: hidden;
    text-decoration: none; display: flex; flex-direction: column; transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.product-card:hover { transform: translateY(-4px); box-shadow: 0 8px 16px rgba(0,0,0,0.1); border-color: var(--primary-color); }
.card-img-wrapper { width: 100%;  background-color: #f8f9fa; position: relative; }
.card-img-wrapper img { width: 100%;   height: 140px; object-fit: cover; display: block; }
.no-img { width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; color: #999; font-size: 14px; }
.card-title { padding: 10px; text-align: center; background: #fff; }
.card-title h3 {
    margin: 0;
    font-size: 14px; /* این مقدار از 16px کمتر شده است */
    color: #2c3e50;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.product-card p { font-size: 0.85rem; color: var(--text-muted); padding: 0 15px 15px; margin-top: -5px; }

/* --- Page Grid (Screenshots) - Masonry (JS Based) --- */
.page-grid {
    display: block; /* تغییر از column-count به حالت بلاک برای کتابخانه میسونری */
    margin-top: 30px;
}

.page-card {
    background-color: #fff; 
    border: 1px solid #e0e0e0; 
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.05); 
    overflow: hidden;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    margin-bottom: 15px; 
    display: flex; 
    flex-direction: column;
        float: right; 

    /* عرض پیش‌فرض دسکتاپ: ۴ ستونه */
    /* فاصله خالی (گپ) را با کم کردن عدد از درصد مدیریت می‌کنیم */
    width: calc(25% - 15px);
        opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.4s ease-out, transform 0.4s ease-out;
}

.page-card.show-card {
    opacity: 1;
    transform: translateY(0);
}

.page-card:hover { 
    transform: translateY(-5px); 
    box-shadow: 0 6px 12px rgba(0,0,0,0.1); 
}

/* --- ریسپانسیو کردن عرض کارت‌ها در حالت Masonry --- */
@media (max-width: 1140px) { 
    .page-card { width: calc(33.333% - 15px); } /* ۳ ستونه */
}

@media (max-width: 900px) { 
    .page-card { width: calc(33.333% - 15px); } /* ۳ ستونه */
}

@media (max-width: 768px) { 
    .page-card { width: calc(33.333% - 15px); } /* ۳ ستونه */
}

@media (max-width: 600px) { 
    .page-card { 
        width: calc(50% - 12px); /* ۲ ستونه */
        margin-bottom: 12px;
    } 
}

@media (max-width: 480px) { 
    .page-card { width: calc(50% - 12px); } /* ۲ ستونه */
}


/* حذف ارتفاع ثابت (480) و تبدیل به auto برای نمایش سایز واقعی */
.screenshot-wrapper {
    position: relative;
}
.screenshot-link { 
    display: block; 
    width: 100%; 
    height: auto; 
    text-decoration: none;
    padding: 0;
    margin: 0;
}


.screenshot-wrapper img {
    width: 100%;
    height: auto;
    display: block;
    margin: 0;
    padding: 0;
    box-sizing: border-box; /* جلوگیری از تاثیر پدینگ روی عرض */
}
.no-image { font-size: 14px; color: #888; padding: 50px 0; }

.page-info { padding: 10px; text-align: center; flex-grow: 1; }
.page-info h4 { margin: 0; font-size: 13px; color: #333; font-weight: 400; }

.version-badge { background-color: #eaf2f8; color: #2980b9; padding: 3px 8px; border-radius: 12px; font-size: 12px; font-weight: bold; }
.page-actions { display: flex; gap: 10px; padding: 15px; border-top: 1px solid #f0f0f0; }

.page-actions a { flex: 1; text-align: center; text-decoration: none; padding: 8px; border-radius: 5px; font-size: 14px; transition: background-color 0.2s ease; }
.btn-download { background-color: #27ae60; color: #fff; }
.btn-download:hover { background-color: #229954; }
.btn-history { background-color: #f1f1f1; color: #333; }
.btn-history:hover { background-color: #e0e0e0; }

.floating-download {
    position: absolute; bottom: 12px; left: 12px; width: 36px; height: 36px;
    background-color: #ffffff; color: #27ae60; border-radius: 50%; display: flex; align-items: center; justify-content: center;
    box-shadow: 0 2px 6px rgba(0,0,0,0.2); transition: all 0.2s ease; z-index: 10;
}
.floating-download:hover { transform: scale(1.1); background-color: #f1f1f1; }

/* --- History Grid --- */
.history-header { margin-bottom: 20px; padding-bottom: 10px; border-bottom: 1px solid #eaeaea; }
.history-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 15px; margin-top: 20px; }
.history-card { background: #fff; border: 1px solid #e2e8f0; border-radius: 12px; overflow: hidden; box-shadow: 0 2px 4px rgba(0,0,0,0.05); display: flex; flex-direction: column; transition: transform 0.2s ease, box-shadow 0.2s ease; }
.history-card:hover { transform: translateY(-3px); box-shadow: 0 8px 16px rgba(0,0,0,0.1); }
.history-image { height: 200px;  background: #f8fafc; padding: 10px; display: flex; align-items: center; justify-content: center; border-bottom: 1px solid #e2e8f0; overflow: hidden; position: relative; }
.history-image img { max-width: 100%; max-height: 100%; object-fit: contain; border-radius: 4px; transition: transform 0.1s ease; }
.history-details { padding: 15px; display: flex; flex-direction: column; align-items: center; gap: 12px; }
.history-details .date { font-size: 0.85em; color: #64748b; }
.empty-msg { color: #64748b; text-align: center; padding: 40px; background: #f8fafc; border-radius: 8px; grid-column: 1 / -1; column-span: all; }



/* ==========================================================================
   7. Specific Components (Breadcrumb, Project Headers, Tags)
   ========================================================================== */
.breadcrumb { margin-bottom: 12px; color: #555; }
.breadcrumb a { color: #3498db; text-decoration: none; }
.breadcrumb a:hover { text-decoration: underline; }
.project-header { margin-bottom: 16px; border-bottom: 1px solid #eee; padding-bottom: 20px; }
.project-meta { margin-top: 10px; display: flex; align-items: center; gap: 15px; color: #777; }
.project-meta .badge { background-color: #ecf0f1; color: #7f8c8d; padding: 5px 12px; border-radius: 15px; }

.load-more-wrapper { text-align: center; margin-top: 40px; }
#load-more-btn { padding: 10px 25px; background: #fff; color: #555; border: 1px solid #ccc; border-radius: 6px; cursor: pointer; font-family: inherit; }
#load-more-btn:hover { background: #f9f9f9; }

/* Tag Management */
.tag-box { border: 1px solid #ddd; border-radius: 6px; padding: 4px; display: flex; flex-wrap: wrap; gap: 5px; background: #fff; min-height: 38px; align-items: center; }
.chips-area { 
    display: flex; 
    flex-wrap: wrap; 
    gap: 6px; 
    width: 100%; /* جلوگیری از فشرده شدن در یک نقطه */
    align-items: center;
}
.chip.tag-chip { 
    background: #e2e8f0; 
    color: #334155; 
    padding: 4px 10px !important; /* اضافه کردن important برای غلبه بر استایل‌های درون‌خطی */
    border-radius: 12px; 
    font-size: 0.85em; 
    gap: 5px; 
    height: auto;
}
.remove-chip { cursor: pointer; color: #ef4444; font-weight: bold; }
.input-area { position: relative; flex-grow: 1; min-width: 100px; }
.tag-input { border: none !important; outline: none !important; width: 100%; padding: 4px !important; margin: 0 !important; background: transparent; box-shadow: none !important; }
.suggestions-dropdown { position: absolute; top: 100%; right: 0; left: 0; background: #fff; border: 1px solid #ddd; border-radius: 4px; box-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1); z-index: 10; display: none; max-height: 150px; overflow-y: auto; }
.sugg-item { padding: 6px 10px; cursor: pointer; font-size: 0.9em; display: flex; justify-content: space-between; align-items: center; border-bottom: 1px solid #f1f5f9; }
.sugg-item:hover { background: #f8fafc; }
.sugg-add-btn { background: #16a34a; color: white; border: none; padding: 2px 8px; border-radius: 4px; font-size: 0.8em; cursor: pointer; }
.upload-inline-form { display: flex; gap: 5px; align-items: center; }
.badge { background: #e9ecef; padding: 2px 8px; border-radius: 4px; font-size: 0.9em; }

/* ==========================================================================
   8. Responsive Design (Mobile & Tablet)
   ========================================================================== */
@media (max-width: 992px) {
    .sidebar { transform: translateX(100%); }
    .sidebar.show { transform: translateX(0); }
    .main-content { margin-right: 0; width: 100%; padding: 16px; margin-top: 20px; }
    .mobile-header { display: flex; border-radius: 8px; }
    .overlay.show { display: block; }
}

@media (max-width: 768px) {
    /* Responsive Header Adjustments */
    .header-wrapper { flex-direction: column; gap: 15px; }
    .main-nav { flex-wrap: wrap; justify-content: center; }
    
    /* Responsive Tables */

    .data-table thead, .data-table th { display: none; }
    .data-table { background: transparent; box-shadow: none; display: block; width: 100%; border: none; }
    .data-table tbody, .data-table tr, .data-table td { display: block; width: 100%; }
    .data-table tr { margin-bottom: 15px; border: 1px solid var(--border-color); border-radius: 8px; padding: 10px; background: var(--bg-card); }
    .data-table td { text-align: right; padding: 8px 0; border-bottom: 1px dashed var(--border-color); display: flex; justify-content: space-between; align-items: center; }
.data-table td:last-child { border-bottom: none; justify-content: space-between; gap: 10px; }
    .data-table td::before { content: attr(data-label); font-weight: 700; color: var(--text-muted); font-size: 0.85rem; }


    .data-table tr { margin-bottom: 15px; border: 1px solid var(--border-color); border-radius: 8px; padding: 10px; }
    .data-table td { text-align: right; padding: 8px 0; border-bottom: 1px dashed var(--border-color); display: flex; justify-content: space-between; align-items: center; }
    .data-table td:last-child { border-bottom: none; justify-content: flex-end; gap: 10px; }
    .data-table td::before { content: attr(data-label); font-weight: 700; color: var(--text-muted); font-size: 0.85rem; }
    
    .add-form { flex-direction: column; padding: 16px; align-items: stretch; }
    .add-form input, .add-form select, .add-form button { width: 100%; }

    /* Adjust Box Heights for Mobile */
    .screenshot-wrapper { height: auto; }

    .history-image { height: 220px; }
}

@media (max-width: 480px) {
    .product-grid, .history-grid {
        grid-template-columns: 1fr;
    }
}




/* ==========================================================================
   8. Login
   ========================================================================== */

    /* ا (کارت و وسط چین کردن) */
    .login-container {
        display: flex;
        justify-content: center;
        align-items: center;
        min-height: calc(100vh - 160px); /* قرار گرفتن در وسط صفحه */
        padding: 20px;
    }
    
    .login-box {
        background: var(--bg-card);
        padding: 35px 30px;
        border-radius: 12px;
        box-shadow: 0 8px 20px rgba(0, 0, 0, 0.08);
        border: 1px solid var(--border-color);
        width: 100%;
        max-width: 400px; /* کاهش عرض فرم */
    }
    
    .login-box h2 {
        text-align: center;
        margin-bottom: 25px;
        color: var(--text-main);
        font-weight: 700;
    }
    
    .login-box label {
        display: block;
        margin-bottom: 8px;
        font-weight: 500;
        color: var(--text-muted);
    }
    
    .btn-full {
        width: 100%;
        margin-top: 15px;
        padding: 12px;
        font-size: 16px;
    }
    
    .alert-danger {
        color: var(--danger-color);
        background-color: #fee2e2;
        border: 1px solid #fca5a5;
        padding: 10px;
        border-radius: 6px;
        margin-bottom: 20px;
        text-align: center;
    }


/* ==========================================================================
   8. admin
   ========================================================================== */



    .page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px; /* ایجاد فاصله با فرم زیرین */
}

/* حذف مارجین پایین دکمه بازگشت وقتی داخل این هدر است */
.page-header .btn-back {
    margin-bottom: 0;
}



/* ==========================================================================
   filter mobile
   ========================================================================== */


@media (max-width: 768px) {
    .filter-chips, .category-chips {
        flex-wrap: nowrap; /* جلوگیری از رفتن چیپ‌ها به خط بعد */
        -webkit-overflow-scrolling: touch; /* برای اسکرول نرم و روان در گوشی */
    }

    /* مخفی کردن نوار اسکرول افقی برای زیبایی بیشتر (اختیاری) */
    .filter-chips::-webkit-scrollbar, .category-chips::-webkit-scrollbar {
        display: none; /* Chrome, Safari, Opera */
    }
    .filter-chips, .category-chips {
        -ms-overflow-style: none; /* IE & Edge */
        scrollbar-width: none; /* Firefox */
    }
}




/* ==========================================================================
        INDEX.php
   ========================================================================== */


.playlist-thumbnails {
    display: grid;
    gap: 2px;
    width: 100%;
    aspect-ratio: 16 / 9; /* تنظیم نسبت ابعاد کارت */
    background-color: #f1f1f1;
    overflow: hidden;
    border-radius: 8px 8px 0 0;
}

.playlist-thumbnails img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* اگر 1 تصویر باشد */
.playlist-thumbnails[data-count="1"] {
    grid-template-columns: 1fr;
}

/* اگر 2 تصویر باشد */
.playlist-thumbnails[data-count="2"] {
    grid-template-columns: 1fr 1fr;
}

/* اگر 3 تصویر باشد (تصویر اول بزرگتر) */
.playlist-thumbnails[data-count="3"] {
    grid-template-columns: 1fr 1fr;
    grid-template-rows: 1fr 1fr;
}
.playlist-thumbnails[data-count="3"] img:first-child {
    grid-row: span 2;
}

/* اگر 4 تصویر باشد */
.playlist-thumbnails[data-count="4"] {
    grid-template-columns: 1fr 1fr;
    grid-template-rows: 1fr 1fr;
}

.no-img {
    display: flex;
    align-items: center;
    justify-content: center;
    color: #999;
    font-size: 14px;
    grid-column: 1 / -1;
}


/* C:\xampp\htdocs\screenshoti\admin\manage-screens.php */

.desc-input {
    width: 100%;
    min-height: 60px;
    resize: vertical;
    border: 1px solid #ccc;
    border-radius: 4px;
    padding: 8px;
    font-family: inherit;
    font-size: 13px;
}
.desc-input:focus {
    outline: none;
    border-color: #007bff;
}
.desc-saved-msg {
    display: none;
    color: #28a745;
    font-size: 12px;
    margin-top: 5px;
}


.back-icon {
    text-decoration: none;
    font-size: 22px;
    color: #333;
    transition: transform 0.2s;
}
.back-icon:hover {
    transform: scale(1.1);
}


.suggestion-item {
    cursor: pointer;
    padding: 8px 10px;
    transition: background-color 0.2s;
}

.suggestion-item:hover {
    background-color: #f0f0f0;
}

.suggestion-item.active {
    background-color: #f0f0f0;
}


/*  C:\xampp\htdocs\screenshoti\detailScreen.php*/


/* ==========================================================================
   Detail Screen
   ========================================================================== */
.detail-container {
    display: flex;
    gap: 30px;
    margin-top: 20px;
    align-items: flex-start;
}

.detail-image-box {
    flex: 1.5; /* در کد قبلی 2 بود، به 1.5 کاهش یافت تا فضای کمتری بگیرد */
    position: relative;
    background: #f8f9fa;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    overflow: hidden;
    text-align: center; 
}


/* محدود کردن ارتفاع عکس که تمام صفحه را پر نکند */
.detail-image-box img {
    width: auto;
    max-width: 100%;
    max-height: 70vh; /* حداکثر ارتفاع معادل 70 درصد ارتفاع مرورگر */
    object-fit: contain; /* جلوگیری از کشیدگی تصویر */
    display: inline-block;
}

.detail-info-box {
    flex: 1;
    background: var(--bg-card);
    padding: 20px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.02);
}

.btn-edit {
    display: block;
    width: 100%;
    text-align: center;
    background-color: #3b82f6;
    color: #ffffff !important;
    padding: 10px 15px;
    border-radius: 6px;
    font-weight: bold;
    text-decoration: none;
    transition: background-color 0.2s ease;
}


.btn-edit:hover {
    background-color: #2563eb;
}

.info-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px dashed var(--border-color);
}

.creator-info {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: bold;
    color: var(--text-main);
}

.avatar-sm {
    width: 32px;
    height: 32px;
    background: #e2e8f0;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #64748b;
}

.avatar-sm svg {
    width: 18px;
    height: 18px;
}

.badge-public { background: #dcfce7; color: #16a34a; }
.badge-private { background: #fee2e2; color: #ef4444; }

.detail-desc {
    margin-top: 15px;
    font-size: 0.95rem;
}

.detail-divider {
    border: 0;
    height: 1px;
    background: var(--border-color);
    margin: 40px 0 20px;
}

@media (max-width: 768px) {
    .detail-container {
        flex-direction: column;
    }
    .detail-image-box, .detail-info-box {
        width: 100%;
        flex: none;
    }
}


.search-section {
    position: relative;
}

.search-section input[type="text"] {
    margin-bottom: 0 !important;
}

#clear-search {
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}


/* حذف پدینگ اضافی container وقتی داخل main-content قرار دارد (مشکل صفحه جزئیات) */
.main-content .container {
    padding-left: 0;
    padding-right: 0;
}

/* تنظیم پدینگ محتوای اصلی به 12px در حالت موبایل/تبلت (اعمال روی صفحه Screens و سایر صفحات) */
@media (max-width: 992px) {
    .main-content {
        padding: 12px !important;
    }
}


.back-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #f5f5f5;
    border-radius: 50%;
    width: 32px; /* کاهش از 40px */
    height: 32px; /* کاهش از 40px */
    transition: background 0.3s ease;
}

.back-btn img, 
.back-btn svg {
    width: 16px !important;
    height: 16px !important;
}

.back-btn:hover {
    background: #e0e0e0;
}



/* کدهای اضافه شده برای منوی موبایل پنل کاربری */
.mobile-profile-links {
    display: none;
}

@media screen and (max-width: 768px) {
    .btn-profile {
        display: none !important; /* مخفی کردن دکمه حساب کاربری دسکتاپ در موبایل */
    }
    
    .mobile-profile-links {
        display: flex;
        flex-direction: column;
        gap: 15px;
        margin-top: 10px;
        width: 100%;
        text-align: right; /* راست چین شده */
    }
    
    /* خط حذف شد در نتیجه استایل خط هم نیاز نیست */

    .mobile-profile-links a {
        color: var(--text-main);
        font-weight: 500;
        text-decoration: none;
        transition: var(--transition);
        display: block;
        width: 100%;
        text-align: right; /* راست چین شده */
    }

    .mobile-profile-links a:hover, 
    .mobile-profile-links a.active {
        color: var(--primary-color);
    }
}



/* ==========================================================================
   Add To List Features (Detail Screen)
   ========================================================================== */

/* جایگزینی کلاس قدیمی floating-download با ساختار جدید برای کنار هم بودن دکمه‌ها */
.floating-download { display: none; /* مخفی کردن کلاس قدیمی که بالا تعریف شده بود اگر تداخلی داشت */ } 

.floating-actions {
    position: absolute; 
    bottom: 12px; 
    left: 12px; 
    display: flex; 
    gap: 10px; 
    z-index: 10;
}

.action-btn {
    width: 36px; 
    height: 36px;
    background-color: #ffffff; 
    color: #27ae60; 
    border-radius: 50%; 
    display: flex; 
    align-items: center; 
    justify-content: center;
    box-shadow: 0 2px 6px rgba(0,0,0,0.2); 
    transition: all 0.2s ease; 
    border: none; 
    cursor: pointer;
    text-decoration: none;
}
.action-btn:hover { 
    transform: scale(1.1); 
    background-color: #f1f1f1; 
}

/* Modal & Bottom Sheet Styles */
.list-modal-overlay {
    display: none; 
    position: fixed; 
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,0.5); 
    z-index: 1200; 
    align-items: center; 
    justify-content: center;
}

.list-modal-content {
    background: var(--bg-card); 
    padding: 20px; 
    border-radius: 12px; 
    width: 90%; 
    max-width: 400px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2); 
    display: flex; 
    flex-direction: column; 
    max-height: 80vh;
}

.list-modal-header { 
    display: flex; 
    justify-content: space-between; 
    align-items: center; 
    margin-bottom: 15px; 
    border-bottom: 1px solid var(--border-color); 
    padding-bottom: 10px;
}
.list-modal-header h3 { font-size: 1.1rem; margin: 0; }
.close-list-modal { font-size: 1.5rem; cursor: pointer; color: var(--text-muted); line-height: 1;}

.user-lists-ul { 
    list-style: none; 
    overflow-y: auto; 
    flex-grow: 1; 
    margin-bottom: 15px; 
    padding-left: 0; 
}
.user-list-item { 
    display: flex; 
    justify-content: space-between; 
    align-items: center; 
    padding: 10px 0; 
    border-bottom: 1px dashed var(--border-color); 
}
.user-list-item:last-child { border-bottom: none; }

.btn-add-to-list { padding: 5px 12px; font-size: 0.8rem; }

.create-list-box { display: flex; gap: 10px; margin-top: auto; }
.create-list-box input { margin-bottom: 0; flex-grow: 1; }

@media (max-width: 768px) {
    .list-modal-overlay { align-items: flex-end; }
    .list-modal-content {
        width: 100%; 
        max-width: none; 
        border-radius: 20px 20px 0 0;
        padding-bottom: 30px; 
        max-height: 70vh; /* حدود دو سوم صفحه */
        animation: slideSheetUp 0.3s ease-out;
    }
}

@keyframes slideSheetUp {
    from { transform: translateY(100%); }
    to { transform: translateY(0); }
}


/* ==========================================================================
   Floating Add Button (Index Page)
   ========================================================================== */

.floating-add-btn {
    position: absolute;
    bottom: 12px;
    left: 12px;
    z-index: 10;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

/* نمایش دکمه هنگام هاور روی کادر عکس (مخصوص دسکتاپ) */
.screenshot-wrapper:hover .floating-add-btn {
    opacity: 1;
    visibility: visible;
}

/* در موبایل و تبلت همیشه ثابت و قابل مشاهده باشد */
@media (max-width: 768px) {
    .floating-add-btn {
        opacity: 1;
        visibility: visible;
    }
}


/* استایل دکمه دانلود (مشکی) */
.btn-dl-black {
    background-color: #000000 !important;
    color: #ffffff !important;
}
.btn-dl-black:hover {
    background-color: #333333 !important;
    transform: scale(1.1);
}

/* استایل دکمه افزودن (سبز) */
.btn-add-green {
    background-color: var(--primary-color) !important;
    color: #ffffff !important;
}
.btn-add-green:hover {
    background-color: var(--primary-hover) !important;
    transform: scale(1.1);
}

/* سفید کردن آیکون img در دکمه سبز (در صورتی که آیکون فعلی تیره/رنگی است) */
.btn-add-green img {
    filter: brightness(0) invert(1);
}


.create-list-box .btn {
    background-color: transparent;
    color: var(--primary-color);
    border: 1px solid var(--primary-color);
}

.create-list-box .btn:hover {
    background-color: var(--primary-color);
    color: #ffffff;
}

/* index */


/* استایل دکمه شیر */
.btn-share-black {
    background-color: #000000 !important;
    color: #ffffff !important;
}
.btn-share-black:hover {
    background-color: #333333 !important;
    transform: scale(1.1);
}


.btn-share-black img {
    width: 16px !important;
    height: 16px !important;
    object-fit: contain;
    filter: brightness(0) invert(1);
}
/* استایل اصلی با اضافه شدن جلوگیری از شکستن خط */
.toast-minimal {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    background-color: #222;
    color: #fff;
    padding: 10px 24px;
    border-radius: 50px;
    font-size: 13px;
    z-index: 9999;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, bottom 0.3s ease;
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
    white-space: nowrap; /* این خط متن را در یک خط نگه می‌دارد */
}

.toast-minimal.show {
    opacity: 1;
    visibility: visible;
    bottom: 40px;
}

/* بهینه‌سازی برای موبایل */
@media (max-width: 480px) {
    .toast-minimal {
        font-size: 11px; /* کوچکتر کردن فونت */
        padding: 8px 16px; /* کاهش فضای داخلی برای جمع‌وجور شدن */
        max-width: 90vw; /* جلوگیری از بیرون زدن از لبه‌های صفحه */
        overflow: hidden;
        text-overflow: ellipsis; /* اگر باز هم جا نشد سه‌نقطه شود */
    }
}


/* مخفی کردن آیکون‌های موبایل در سایز دسکتاپ */
.mobile-header-icons {
    display: none;
}

@media (max-width: 768px) {
    /* کوچک کردن عرض لوگو در موبایل */
    .site-logo {
        max-height: 28px !important; /* سایز کوچکتر لوگو */
        width: auto;
    }

    /* تنظیمات هدر موبایل برای جاگیری ۳ عنصر */
    .header-wrapper {
        justify-content: space-between !important;
        align-items: center;
    }

    /* نمایش و استایل آیکون‌های سمت چپ */
    .mobile-header-icons {
        display: flex;
        align-items: center;
        gap: 15px;
        margin-right: auto; /* هول دادن آیکون‌ها به سمت چپ */
    }

    .mobile-header-icons .m-icon {
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .mobile-header-icons .m-icon img {
        width: 18px;
        height: 18px;
        object-fit: contain;
    }
}


.btn-edit-sm {
    padding: 4px 12px;
    font-size: 0.85rem;
}

.screen-lists-info {
    margin-top: 15px;
    font-size: 0.9rem;
    color: #555;
}
.list-link {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: bold;
}
.screen-tags-info {
    margin-top: 15px;
    font-size: 0.9rem;
    color: #555;
    margin-bottom: 8px;
}
.detail-chips {
    margin-top: 5px;
}
.detail-chips .tag-chip {
    font-size: 0.8rem;
    padding: 4px 10px;
    text-decoration: none;
    color: inherit;
}


/* ذره بین */

.detail-image-box {
    overflow: hidden;
}

#main-detail-image {
    transition: transform 0.1s ease;
    will-change: transform;
}

@media (min-width: 769px) {
    .detail-image-box {
        cursor: zoom-in;
    }
}

@media (max-width: 768px) {
    #main-detail-image {
        cursor: pointer;
    }
}


/* بازخورد */

/* Feedback Floating Button */
.feedback-floating-btn {
    position: fixed;
    left: 0;
    bottom: 20px; /* تغییر: نزدیک‌تر شدن به پایین صفحه */
    background-color: #dc3545;
    color: white;
    font-size: 11px;
    padding: 12px 4px;
    /* چون المان ۱۸۰ درجه چرخیده، انحناها را برعکس دادیم تا در سمت راست (درست) بیفتد */
    border-radius: 8px 0 0 8px; 
    cursor: pointer;
    z-index: 9999;
    writing-mode: vertical-rl;
    text-orientation: mixed;
    /* تغییر: چرخش ۱۸۰ درجه برای برعکس شدن نوشته */
    transform: rotate(180deg) translateX(0); 
    /* سایه هم به خاطر چرخش منفی شد تا سمت راست بیفتد */
    box-shadow: -2px 0 5px rgba(0,0,0,0.2); 
    /* تغییر: انیمیشن روان (ease-in-out) بدون پرش (jump) */
    transition: transform 0.5s ease-in-out; 
}

.feedback-floating-btn.hide-feedback {
    /* چون المان چرخیده است، حرکت مثبت در محور X باعث رفتن به سمت چپ (خارج صفحه) می‌شود */
    transform: rotate(180deg) translateX(100%);
}

.feedback-floating-btn:hover {
    background-color: #c82333;
}

/* Feedback Modal Styles */
.feedback-body {
    padding: 15px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.feedback-body textarea {
    width: 100%;
    height: 120px;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 8px;
    resize: none;
    font-family: inherit;
    font-size: 14px;
}

.btn-submit-feedback {
    background-color: #007bff;
    color: white;
    border: none;
    padding: 10px;
    border-radius: 8px;
    cursor: pointer;
    font-family: inherit;
    transition: opacity 0.2s;
}

.btn-submit-feedback:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}


/* کاهش پدینگ چپ و راست باکسی که مودال در آن قرار دارد */
#feedback-modal .list-modal-content {
    padding-left: 15px;
    padding-right: 15px;
}

/* کوچک‌تر کردن فونت عنوان مودال */
#feedback-modal h2, 
#feedback-modal h3, 
#feedback-modal .modal-title {
    font-size: 16px;
}

/* کوچک‌تر کردن فونت فیلد متنی و placeholder */
#feedback-text {
    font-size: 13px;
}
#feedback-text::placeholder {
    font-size: 13px;
}

/* استفاده از آیکون برای دکمه بستن (ضربدر) و مخفی کردن متن قبلی */
#feedback-modal .close-modal {
    width: 20px;
    height: 20px;
    background: url('/assets/image/xmark.svg') no-repeat center center;
    background-size: contain;
    border: none;
    cursor: pointer;
    font-size: 0; /* برای مخفی کردن ضربدر متنی قبلی */
    color: transparent;
    opacity: 0.6;
    transition: var(--transition);
}

#feedback-modal .close-modal:hover {
    opacity: 1;
}

/* تغییر رنگ دکمه ارسال به سبز بر اساس متغیرهای روت */
#submit-feedback-btn {
    background-color: var(--primary-color);
    color: #fff;
    border: none;
    transition: var(--transition);
}

#submit-feedback-btn:hover {
    background-color: var(--primary-hover);
}


/* مدیریت بازخورد */

/* استایل‌های جدول بازخوردها */
.feedback-text-cell {
    max-width: 300px;
    white-space: normal;
    line-height: 1.6;
    font-size: 14px;
}

.feedback-unread {
    background-color: var(--primary-light);
    font-weight: bold;
}

.feedback-read {
    opacity: 0.8;
}

/* استایل برچسب‌های وضعیت */
.badge {
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: normal;
}

.badge-success {
    background-color: var(--primary-light);
    color: var(--primary-hover);
    border: 1px solid var(--primary-color);
}

.badge-warning {
    background-color: #fef08a;
    color: #854d0e;
    border: 1px solid #eab308;
}

/* برای نمایش متن کم‌رنگ */
.text-muted {
    color: var(--text-muted);
    font-style: italic;
}


/* تنظیم فاصله و چیدمان تگ‌ها در کارت‌ها */
.tags-container {
    padding: 10px;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

/* کاهش پدینگ داخلی تگ‌ها در صفحه اصلی برای ظرافت بیشتر */
.tags-container .tag-chip {
    padding: 2px 8px !important;
}

/* تنظیم سایز آیکون پلاس دقیقا مشابه آیکون شیر */
.btn-add-green img {
    width: 16px !important;
    height: 16px !important;
    object-fit: contain;
    filter: brightness(0) invert(1);
}

.floating-actions-index {
    position: absolute;
    bottom: 12px;
    left: 12px;
    display: flex;
    flex-direction: row; /* قرارگیری کنار هم */
    gap: 8px; /* فاصله بین دو دکمه */
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    z-index: 10;
}


@media (min-width: 769px) {
    .screenshot-wrapper:hover .floating-actions-index {
        opacity: 1;
        visibility: visible;
    }
}

/* حذف موقت دکمه اضافه کردن به لیست و شیر در موبایل */
@media (max-width: 768px) {
    .floating-actions-index {
        display: none !important;
    }
}



/* ==========================================================================
کدهای حساب کاربری کاربر
   ========================================================================== */

   .profile-container {
    max-width: 450px;
    margin: 50px auto;
    padding: 30px;
    background-color: #ffffff;
    border-radius: 10px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    direction: rtl;
}

.profile-container h2 {
    text-align: center;
    margin-bottom: 25px;
    color: #333;
}

.profile-container .form-group {
    margin-bottom: 20px;
}

.profile-container label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #555;
}

.profile-container input[type="text"],
.profile-container input[type="password"] {
    width: 100%;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    box-sizing: border-box;
    font-family: inherit;
    transition: border-color 0.3s;
}

.profile-container input[type="text"]:focus,
.profile-container input[type="password"]:focus {
    border-color: #007bff;
    outline: none;
}

.profile-container input[disabled] {
    background-color: #f1f1f1;
    color: #888;
    cursor: not-allowed;
    border-color: #e2e2e2;
}

.profile-container .btn-submit {
    width: 100%;
    padding: 12px;
    background-color: #007bff;
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    transition: background-color 0.3s;
    margin-top: 10px;
}

.profile-container .btn-submit:hover {
    background-color: #0056b3;
}

.alert {
    padding: 12px;
    margin-bottom: 20px;
    border-radius: 6px;
    text-align: center;
}

.alert-success {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}


.my-lists-header {
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    margin-bottom: 25px;
}

.list-modal-overlay.show {
    display: flex !important;
}


.page-title-action {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}



/* Add Image Modal Styles */
.large-modal {
    max-width: 900px !important;
    width: 95%;
    overflow: hidden; /* جلوگیری از بیرون زدن محتوا از مودال */
}

.scrollable-body {
    padding: 20px 0;
    overflow-y: auto;
    flex: 1; /* باعث می‌شود بدنه مودال کل فضای باقیمانده را بگیرد و اسکرول شود */
}

.screen-row {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 15px;
}
.screen-row:last-child { margin-bottom: 0; }

.preview-link { display: block; }
.preview-img {
    width: 100%;
    max-height: 420px;
    height: auto;
    border-radius: 8px;
    display: block;
    object-fit: contain;
    background: var(--bg-hover);
    cursor: pointer;
    margin-bottom: 12px;
}

.screen-row-fields {
    display: flex;
    gap: 12px;
    align-items: flex-start;
}
.screen-row-fields .field-group { flex: 1; min-width: 0; }
.screen-row-fields label { display: block; font-size: 0.85rem; color: var(--text-muted); margin-bottom: 5px; }
.screen-row-fields .trash-btn { flex: 0 0 auto; align-self: flex-end; }

@media (max-width: 768px) {
    .screen-row-fields { flex-direction: column; }
    .screen-row-fields .trash-btn { align-self: flex-end; }
}

.upload-area {
    border: 2px dashed var(--border);
    padding: 30px;
    text-align: center;
    border-radius: 8px;
    margin-bottom: 20px;
    background-color: var(--bg-hover);
}

.upload-btn {
    display: inline-block;
    cursor: pointer;
    margin-bottom: 10px;
}

.upload-note {
    font-size: 12px;
    color: var(--text-muted);
}

.trash-btn {
    background: none;
    border: none;
    cursor: pointer;
    padding: 5px;
}

.trash-btn:hover {
    opacity: 0.7;
}

.desc-input {
    width: 100%;
    min-height: 60px;
    padding: 8px;
    border: 1px solid var(--border);
    border-radius: 5px;
    background: var(--bg-input);
    color: var(--text-main);
    resize: vertical;
}


.footer-left {
    margin-top: 20px;
    text-align: left;
}




/* کدهای اسکلتون */


/* Skeleton Loader Styles */
.screen-image-wrapper {
    position: relative;
    width: 100%;
    height: 100%; /* ارتفاع پیش‌فرض را در صورت نیاز تنظیم کنید */
    background-color: #f0f0f0;
    overflow: hidden;
}

.skeleton-box::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: skeleton-loading 1.5s infinite;
    z-index: 1;
}

/* Skeleton Loader Styles */
.screenshot-wrapper.skeleton-box {
    position: relative;
    background-color: #f0f0f0;
    overflow: hidden;
    width: 100%;
    /* نسبت ابعاد مستطیل عمودی (استاندارد موبایل) */
    aspect-ratio: 9 / 19; 
    /* اگر مرورگرهای خیلی قدیمی مد نظرتونه، خط بالا رو پاک کنید و از خط پایین استفاده کنید */
    /* min-height: 450px; */
}


.screenshot-wrapper.skeleton-box::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: skeleton-loading 1.5s infinite;
    z-index: 10; /* قرارگیری روی تصویر تا زمان لود */
}


@keyframes skeleton-loading {
    0% {
        background-position: 200% 0;
    }
    100% {
        background-position: -200% 0;
    }
}


.screenshot-wrapper.skeleton-box ~ .screenshot-tags {
    opacity: 0;
    visibility: hidden;
}


/* ==========================================================================
        کدهای سرچ
   ========================================================================== */
/* نوار جستجوی دسکتاپ */
.desktop-search-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background-color: var(--bg-color, #f9f9f9);
    border: 1px solid var(--border-color, #ddd);
    border-radius: 8px;
    padding: 6px 12px;
    margin-left: 15px;
    width: 200px;
    text-decoration: none;
    color: #888;
    cursor: pointer;
    transition: all 0.3s ease;
}

.desktop-search-bar:hover {
    border-color: #bbb;
    background-color: #f1f1f1;
}

.search-placeholder {
    font-size: 13px;
}

.desktop-search-bar img {
    width: 16px; /* آیکون کوچکتر */
    height: 16px;
    filter: invert(0.5);
}

/* مخفی کردن نوار در موبایل */
@media (max-width: 768px) {
    .desktop-search-bar {
        display: none !important;
    }
}


/* تنظیمات هدر لیست */
.list-header {
    margin: 20px 0 30px 0;
    text-align: center;
}

.list-header h1 {
    margin-bottom: 10px;
}

/* قرار دادن اطلاعات کاربر و دکمه به صورت عمودی زیر هم */
.creator-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px; /* فاصله بین نام کاربر و دکمه ویرایش */
}

/* اطلاعات آواتار و نام کاربر (افقی) */
.creator-info {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    color: #666;
}

/* سایز کوچکتر برای آواتار */
.creator-info .avatar-sm {
    width: 24px;
    height: 24px;
}

/* تنظیم سایز دکمه ویرایش */
.edit-list-btn {
    padding: 4px 16px;
    font-size: 0.8rem;
}


#delete-list-modal .modal-actions {
    display: flex;
    gap: 10px;
    margin-top: 20px;
    justify-content: flex-end;
}


/* استایل مربوط به چک باکس مرا به خاطر بسپار */
.remember-me-group {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 20px;
}

.remember-me-group input[type="checkbox"] {
    width: auto;
    margin-bottom: 0;
    cursor: pointer;
}

.remember-me-group label {
    margin-bottom: 0;
    font-size: 14px;
    font-weight: normal;
    cursor: pointer;
}


/* جایگزین کدهای قبلی .btn-logout در فایل style.css کنید */

.sidebar-footer .btn-logout {
    display: block;
    padding: 10px 14px;
    border-radius: 8px;
    color: #e74c3c !important;
    background-color: transparent;
    font-weight: normal;
    text-decoration: none;
    transition: all 0.2s ease;
}

.sidebar-footer .btn-logout:hover {
    background-color: rgba(231, 76, 60, 0.1);
    color: #c0392b !important;
    font-weight: 700;
}

/* استایل دکمه خروج در منوی موبایل (در صورت نیاز) */
.mobile-profile-links .text-danger {
    color: #e74c3c !important;
}

.mobile-profile-links .text-danger:hover {
    background-color: rgba(231, 76, 60, 0.1);
    color: #c0392b !important;
}


.grid-loader {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 9999;
}

.grid-loader::after {
    content: "";
    display: block;
    width: 40px;
    height: 40px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #16a34a;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}
