/*
 * Web Listing FA/RTL - Responsive Full Width Edition
 * Based on web-listing by Maxime Louet
 * https://github.com/maximelouet/web-listing
 * MIT License
 */
/* IRANSansX FaNum — local webfonts supplied by site owner */
@font-face{font-family:'IRANSansX';src:url('fonts/IRANSansXFaNum-Thin.woff') format('woff');font-style:normal;font-weight:100;font-display:swap}
@font-face{font-family:'IRANSansX';src:url('fonts/IRANSansXFaNum-UltraLight.woff') format('woff');font-style:normal;font-weight:200;font-display:swap}
@font-face{font-family:'IRANSansX';src:url('fonts/IRANSansXFaNum-Light.woff') format('woff');font-style:normal;font-weight:300;font-display:swap}
@font-face{font-family:'IRANSansX';src:url('fonts/IRANSansXFaNum-Regular.woff') format('woff');font-style:normal;font-weight:400;font-display:swap}
@font-face{font-family:'IRANSansX';src:url('fonts/IRANSansXFaNum-Medium.woff') format('woff');font-style:normal;font-weight:500;font-display:swap}
@font-face{font-family:'IRANSansX';src:url('fonts/IRANSansXFaNum-DemiBold.woff') format('woff');font-style:normal;font-weight:600;font-display:swap}
@font-face{font-family:'IRANSansX';src:url('fonts/IRANSansXFaNum-Bold.woff') format('woff');font-style:normal;font-weight:700;font-display:swap}
@font-face{font-family:'IRANSansX';src:url('fonts/IRANSansXFaNum-ExtraBold.woff') format('woff');font-style:normal;font-weight:800;font-display:swap}
@font-face{font-family:'IRANSansX';src:url('fonts/IRANSansXFaNum-Black.woff') format('woff');font-style:normal;font-weight:900;font-display:swap}

:root{
    --bg:#fbfcfe;
    --surface:#ffffff;
    --surface-2:#f7f9fc;
    --surface-3:#f1f5f9;
    --text:#0f172a;
    --muted:#64748b;
    --line:#e6ecf3;
    --accent:#0f172a;
    --accent-soft:#eef2f7;
    --danger:#b91c1c;
    --danger-soft:#fef2f2;
    --radius:18px;
}
html[data-theme="dark"]{
    --bg:#0b1120;
    --surface:#0f172a;
    --surface-2:#111b31;
    --surface-3:#16223b;
    --text:#f8fafc;
    --muted:#94a3b8;
    --line:#23314c;
    --accent:#f8fafc;
    --accent-soft:#17243e;
    --danger:#fecaca;
    --danger-soft:#2a1118;
}
*{box-sizing:border-box}
html{color-scheme:light;background:var(--bg);-webkit-text-size-adjust:100%}
html[data-theme="dark"]{color-scheme:dark}
body{
    margin:0;
    min-width:320px;
    background:var(--bg);
    color:var(--text);
    font-family:'IRANSansX',Tahoma,'Segoe UI',Arial,sans-serif;
    font-weight:400;
    -webkit-font-smoothing:antialiased;
    -moz-osx-font-smoothing:grayscale;
    line-height:1.65;
    font-variant-numeric:normal;
}
a{color:inherit}
button,input{font:inherit}
button,a{-webkit-tap-highlight-color:transparent}
.app{
    min-height:100vh;
    width:100%;
    padding:0 clamp(12px,2vw,28px) 24px;
}
.header{
    position:sticky;
    top:0;
    z-index:20;
    background:color-mix(in srgb,var(--bg) 90%,transparent);
    backdrop-filter:blur(14px);
    -webkit-backdrop-filter:blur(14px);
    border-bottom:1px solid var(--line);
    margin:0 calc(clamp(12px,2vw,28px) * -1);
    padding:16px clamp(12px,2vw,28px) 13px;
}
.header-main{
    display:flex;
    align-items:center;
    justify-content:space-between;
    gap:16px;
}
.branding{
    display:flex;
    align-items:center;
    gap:12px;
    min-width:0;
}
.brand-mark{
    width:46px;
    height:46px;
    border-radius:14px;
    display:grid;
    place-items:center;
    background:var(--accent);
    color:var(--surface);
    font-size:24px;
    font-weight:800;
    flex:0 0 auto;
}
.branding h1{
    margin:0 0 4px;
    font-weight:800;
    font-size:clamp(17px,1.5vw,22px);
    line-height:1.2;
    white-space:nowrap;
    overflow:hidden;
    text-overflow:ellipsis;
}
.branding p{
    margin:0;
    font-weight:400;
    color:var(--muted);
    font-size:12px;
}
.header-actions{
    display:flex;
    align-items:center;
    gap:9px;
    flex:0 1 430px;
    justify-content:flex-end;
}
.search-box{
    width:min(380px,100%);
    height:46px;
    border:1px solid var(--line);
    background:var(--surface);
    border-radius:14px;
    display:flex;
    align-items:center;
    gap:8px;
    padding:0 14px;
    color:var(--muted);
}
.search-box:focus-within{border-color:color-mix(in srgb,var(--text) 24%,var(--line))}
.search-box input{
    width:100%;
    font-weight:400;
    min-width:0;
    border:0;
    outline:0;
    background:transparent;
    color:var(--text);
    font-size:13px;
}
.search-box input::placeholder{color:var(--muted)}
.theme-toggle{
    width:46px;
    height:46px;
    flex:0 0 46px;
    border:1px solid var(--line);
    border-radius:14px;
    background:var(--surface);
    color:var(--text);
    cursor:pointer;
}
.subbar{
    display:flex;
    align-items:center;
    justify-content:space-between;
    gap:16px;
    margin-top:12px;
}
.breadcrumbs{
    display:flex;
    align-items:center;
    gap:4px;
    flex-wrap:wrap;
    min-width:0;
}
.breadcrumbs a{
    text-decoration:none;
    font-weight:500;
    color:var(--muted);
    padding:6px 9px;
    border-radius:9px;
    max-width:220px;
    overflow:hidden;
    text-overflow:ellipsis;
    white-space:nowrap;
}
.breadcrumbs a:hover{background:var(--surface);color:var(--text)}
.separator{color:var(--muted);opacity:.45}
.meta{
    display:flex;
    align-items:center;
    gap:9px;
    white-space:nowrap;
}
.meta strong{font-size:14px;font-weight:600;max-width:240px;overflow:hidden;text-overflow:ellipsis}
.meta span{
    font-size:12px;
    color:var(--muted);
    padding:7px 10px;
    border-radius:999px;
    background:var(--surface);
    border:1px solid var(--line);
}
.notice{
    margin:14px 0 0;
    padding:12px 14px;
    border-radius:13px;
    font-size:13px;
}
.notice.error{background:var(--danger-soft);color:var(--danger);border:1px solid rgba(185,28,28,.12)}
.listing-wrap{padding-top:12px}
.listing-table{
    width:100%;
    border-collapse:separate;
    border-spacing:0;
    background:var(--surface);
    border:1px solid var(--line);
    border-radius:var(--radius);
    overflow:hidden;
}
.listing-table thead th{
    background:var(--surface);
    border-bottom:1px solid var(--line);
    color:var(--muted);
    font-weight:600;
    font-size:12px;
    text-align:right;
    padding:15px 18px;
}
.listing-table tbody td{
    padding:13px 18px;
    border-bottom:1px solid var(--line);
    font-size:13px;
    color:var(--muted);
    vertical-align:middle;
}
.listing-table tbody tr:last-child td{border-bottom:0}
.listing-table tbody tr:hover td{background:var(--surface-2)}
.col-name{width:50%}
.col-size{width:14%}
.col-date{width:22%}
.col-action{width:14%}
.name-cell a{
    display:flex;
    align-items:center;
    gap:12px;
    min-width:0;
    text-decoration:none;
    color:var(--text);
    font-weight:600;
}
.file-icon{
    width:36px;
    height:36px;
    flex:0 0 36px;
    border-radius:11px;
    display:grid;
    place-items:center;
    background:var(--surface-2);
    border:1px solid var(--line);
}
.file-icon::before{content:"📄";font-size:17px}
tr.dir .file-icon::before{content:"📁"}
tr.pdf .file-icon::before{content:"📕"}
tr.archive .file-icon::before{content:"📦"}
tr.audio .file-icon::before{content:"🎵"}
tr.video .file-icon::before{content:"🎬"}
tr.image .file-icon::before{content:"🖼️"}
tr.text .file-icon::before{content:"📝"}
tr.doc .file-icon::before{content:"📘"}
tr.calc .file-icon::before{content:"📊"}
tr.pres .file-icon::before{content:"📽️"}
.file-name{overflow-wrap:anywhere;word-break:break-word;min-width:0}
.size-cell,.date-cell{white-space:nowrap}
.action-cell{text-align:left}
.btn{
    min-height:40px;
    display:inline-flex;
    align-items:center;
    justify-content:center;
    padding:9px 14px;
    border-radius:11px;
    text-decoration:none;
    background:var(--accent);
    color:var(--surface);
    font-size:12px;
    font-weight:600;
    white-space:nowrap;
}
.btn-ghost{background:var(--surface-3);color:var(--text)}
.empty-state{
    min-height:55vh;
    display:grid;
    place-items:center;
    align-content:center;
    text-align:center;
    color:var(--muted);
}
.empty-state[hidden]{display:none}
.empty-icon{font-size:36px;margin-bottom:10px}
.empty-state strong{font-size:15px;color:var(--text);margin-bottom:6px}
.empty-state small{font-size:12px}
.footer{
    display:flex;
    justify-content:center;
    gap:8px;
    align-items:center;
    color:var(--muted);
    font-size:11px;
    padding:16px 0 0;
}
.footer a{text-decoration:none}
.footer a:hover{color:var(--text)}

/* Tablet landscape / small laptop */
@media (max-width:1199px){
    .app{padding-inline:18px}
    .header{margin-inline:-18px;padding-inline:18px}
    .header-actions{flex-basis:390px}
    .listing-table thead th,.listing-table tbody td{padding-inline:14px}
    .col-name{width:48%}
}

/* Tablet portrait */
@media (max-width:900px){
    .header-main{align-items:flex-start}
    .branding{flex:1 1 auto}
    .header-actions{flex:0 1 48%;min-width:300px}
    .subbar{align-items:flex-start}
    .breadcrumbs{flex:1 1 auto}
    .meta{flex:0 0 auto}
    .col-name{width:52%}
    .col-size{width:16%}
    .col-date{display:none}
    .date-cell{display:none}
    .col-action{width:18%}
    .listing-table tbody td{padding-block:12px}
}

/* Large mobile / small tablet */
@media (max-width:767px){
    .app{padding:0 10px 14px}
    .header{
        position:relative;
        margin:0 -10px;
        padding:12px 10px 11px;
        backdrop-filter:none;
        -webkit-backdrop-filter:none;
        background:var(--bg);
    }
    .header-main{display:grid;grid-template-columns:1fr auto;align-items:center;gap:10px}
    .branding{min-width:0}
    .brand-mark{width:40px;height:40px;flex-basis:40px;border-radius:12px;font-size:20px}
    .branding h1{font-size:17px}
    .branding p{font-size:10px}
    .header-actions{display:contents}
    .theme-toggle{grid-column:2;grid-row:1;width:42px;height:42px;flex-basis:42px;border-radius:12px}
    .search-box{
        grid-column:1 / -1;
        grid-row:2;
        width:100%;
        height:44px;
        border-radius:12px;
    }
    .subbar{margin-top:10px;display:block}
    .breadcrumbs{
        flex-wrap:nowrap;
        overflow-x:auto;
        padding-bottom:3px;
        scrollbar-width:none;
        -webkit-overflow-scrolling:touch;
    }
    .breadcrumbs::-webkit-scrollbar{display:none}
    .breadcrumbs a{flex:0 0 auto;max-width:180px}
    .meta{margin-top:9px;justify-content:space-between;width:100%}
    .meta strong{font-size:13px;max-width:65vw}
    .meta span{font-size:11px;padding:6px 9px}
    .listing-wrap{padding-top:9px}
    .listing-table{
        display:block;
        border:0;
        background:transparent;
        overflow:visible;
        border-radius:0;
    }
    .listing-table thead{display:none}
    .listing-table tbody{display:grid;gap:8px}
    .listing-table tr{
        display:grid;
        grid-template-columns:minmax(0,1fr) auto;
        grid-template-areas:
            "name action"
            "meta action";
        column-gap:10px;
        row-gap:5px;
        background:var(--surface);
        border:1px solid var(--line);
        border-radius:15px;
        padding:11px 12px;
    }
    .listing-table tbody tr:hover td{background:transparent}
    .listing-table td{
        display:block;
        border:0!important;
        padding:0!important;
        background:transparent!important;
    }
    .name-cell{grid-area:name;min-width:0}
    .name-cell a{gap:10px;align-items:center}
    .file-icon{width:34px;height:34px;flex-basis:34px;border-radius:10px}
    .file-name{font-size:13px;line-height:1.45}
    .size-cell{
        grid-area:meta;
        padding-right:44px!important;
        font-size:11px!important;
        color:var(--muted)!important;
    }
    .size-cell::before{content:"حجم: ";}
    .date-cell{display:none!important}
    .action-cell{
        grid-area:action;
        align-self:center;
        text-align:left;
    }
    .btn{
        min-width:72px;
        min-height:40px;
        padding:8px 12px;
        border-radius:10px;
        font-size:11px;
    }
    .footer{font-size:10px;padding-top:12px;flex-wrap:wrap}
}

/* Small phones */
@media (max-width:480px){
    .app{padding-inline:8px}
    .header{margin-inline:-8px;padding-inline:8px}
    .branding{gap:9px}
    .branding h1{font-size:15px}
    .branding p{display:none}
    .brand-mark{width:38px;height:38px;flex-basis:38px}
    .theme-toggle{width:40px;height:40px}
    .breadcrumbs a{font-size:11px;padding:5px 7px;max-width:145px}
    .meta strong{max-width:58vw}
    .listing-table tr{
        grid-template-columns:minmax(0,1fr) auto;
        padding:10px;
        border-radius:13px;
    }
    .file-name{font-size:12px}
    .size-cell{padding-right:43px!important;font-size:10px!important}
    .btn{min-width:66px;min-height:38px;padding-inline:10px}
}

/* Very narrow screens */
@media (max-width:360px){
    .listing-table tr{
        grid-template-columns:1fr;
        grid-template-areas:"name" "meta" "action";
    }
    .action-cell{text-align:right;margin-top:3px}
    .btn{width:100%}
}

/* Touch devices: avoid hover-dependent interaction */
@media (hover:none){
    .listing-table tbody tr:hover td{background:inherit}
    .btn,.theme-toggle,.breadcrumbs a{touch-action:manipulation}
}


/* V6 brand image update */
.branding{
    display:flex;
    align-items:center;
    gap:14px;
    min-width:0;
}
.brand-visual{
    flex:0 0 auto;
    width:96px;
    height:72px;
    border-radius:18px;
    overflow:hidden;
    border:1px solid var(--line);
    background:var(--surface);
}
.brand-image{
    width:100%;
    height:100%;
    object-fit:cover;
    display:block;
}
.brand-copy{min-width:0}
.brand-copy h1{
    margin:0 0 6px;
    font-size:22px;
    line-height:1.15;
}
.brand-copy p{
    margin:0;
    color:var(--muted);
    font-size:12px;
}
/* remove old square icon if any */
.brand-mark{display:none !important}
@media (max-width: 720px){
    .branding{gap:10px;align-items:center}
    .brand-visual{width:68px;height:52px;border-radius:14px}
    .brand-copy h1{font-size:16px}
    .brand-copy p{font-size:10px}
}
