/* ================================================
   SUN FC KAAE – Document Portal Stylesheet
   Soran University | Kurdish & English
   ================================================ */

:root {
    --primary:   #1a3a5c;
    --accent:    #e8a020;
    --bg:        #f0f4f8;
    --card-bg:   #ffffff;
    --text:      #1e2d3d;
    --text-muted:#6b7c93;
    --border:    #d1dbe8;
    --danger:    #d32f2f;
    --success:   #2e7d32;
    --warning:   #f57c00;
    --radius:    10px;
    --shadow:    0 2px 12px rgba(0,0,0,.1);
    --transition:.2s ease;
}

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

body {
    font-family: 'Segoe UI', 'Arial', sans-serif;
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
    line-height: 1.6;
}

/* Kurdish font support */
[lang="ku"] body, [dir="rtl"] {
    font-family: 'Segoe UI', 'Arial Unicode MS', sans-serif;
}

/* ---- LOGIN PAGE ---- */
.login-page {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background: linear-gradient(135deg, #0d2137 0%, #1a3a5c 50%, #0d2137 100%);
}
.login-container { width: 100%; max-width: 440px; padding: 20px; }
.login-card {
    background: var(--card-bg);
    border-radius: 16px;
    padding: 40px 36px;
    box-shadow: 0 8px 32px rgba(0,0,0,.3);
}
.login-logo { text-align: center; margin-bottom: 28px; }
.login-logo img { height: 72px; margin-bottom: 12px; }
.login-logo h1 { font-size: 1.1rem; color: var(--primary); font-weight: 700; }
.login-logo p  { color: var(--text-muted); font-size: .85rem; margin-top: 4px; }
.top-right { position: fixed; top: 16px; right: 16px; z-index: 999; color: #fff; }

/* ---- NAVBAR ---- */
.navbar {
    background: var(--primary);
    color: #fff;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 2px 8px rgba(0,0,0,.2);
}
.nav-inner {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 24px;
    height: 60px;
    display: flex;
    align-items: center;
    gap: 24px;
}
.nav-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    color: #fff;
    font-weight: 700;
}
.brand-fc {
    background: var(--accent);
    color: #fff;
    padding: 3px 8px;
    border-radius: 6px;
    font-size: .9rem;
    font-weight: 800;
}
.brand-text { font-size: 1rem; }
.nav-links { display: flex; gap: 4px; }
.nav-links a {
    color: rgba(255,255,255,.8);
    text-decoration: none;
    padding: 6px 14px;
    border-radius: var(--radius);
    font-size: .9rem;
    transition: var(--transition);
}
.nav-links a:hover,
.nav-links a.active { background: rgba(255,255,255,.15); color: #fff; }
.nav-right { margin-left: auto; display: flex; align-items: center; gap: 16px; }
.nav-user { display: flex; align-items: center; gap: 8px; }
.user-name { font-size: .9rem; color: rgba(255,255,255,.9); }
.lang-switch { display: flex; gap: 6px; }
.lang-switch a {
    color: rgba(255,255,255,.7);
    text-decoration: none;
    font-size: .85rem;
    padding: 2px 8px;
    border-radius: 4px;
    border: 1px solid rgba(255,255,255,.3);
    transition: var(--transition);
}
.lang-switch a:hover, .lang-switch a.active {
    background: rgba(255,255,255,.2);
    color: #fff;
}

/* ---- LAYOUT ---- */
.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 28px 24px;
}
.section-title {
    font-size: 1.3rem;
    color: var(--primary);
    margin: 32px 0 16px;
    padding-bottom: 8px;
    border-bottom: 2px solid var(--border);
}

/* ---- STATS BAR ---- */
.stats-bar {
    display: flex;
    gap: 16px;
    margin-bottom: 8px;
    flex-wrap: wrap;
}
.stat-card {
    background: var(--card-bg);
    border-radius: var(--radius);
    padding: 16px 28px;
    box-shadow: var(--shadow);
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 140px;
}
.stat-number { font-size: 2rem; font-weight: 800; color: var(--primary); }
.stat-label  { font-size: .8rem; color: var(--text-muted); margin-top: 2px; }

/* ---- FC GRID ---- */
.fc-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 16px;
    margin-bottom: 32px;
}
.fc-card {
    background: var(--card-bg);
    border-radius: var(--radius);
    padding: 20px;
    text-decoration: none;
    color: var(--text);
    box-shadow: var(--shadow);
    border-left: 5px solid var(--primary);
    transition: var(--transition);
    display: flex;
    flex-direction: column;
    gap: 8px;
}
[dir="rtl"] .fc-card { border-left: none; border-right: 5px solid var(--primary); }
.fc-card:hover { transform: translateY(-3px); box-shadow: 0 6px 20px rgba(0,0,0,.15); }
.fc-number { font-size: .75rem; font-weight: 700; color: #fff; background: var(--primary); padding: 2px 8px; border-radius: 4px; width: fit-content; }
.fc-name   { font-size: 1rem; font-weight: 600; color: var(--primary); }
.fc-meta   { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 8px; margin-top: 4px; }
.fc-owner  { font-size: .8rem; color: var(--text-muted); }

/* FC Color Variants */
.fc-color-1 { border-left-color: #1976d2; } .fc-color-1 .fc-number { background: #1976d2; }
.fc-color-2 { border-left-color: #388e3c; } .fc-color-2 .fc-number { background: #388e3c; }
.fc-color-3 { border-left-color: #7b1fa2; } .fc-color-3 .fc-number { background: #7b1fa2; }
.fc-color-4 { border-left-color: #e64a19; } .fc-color-4 .fc-number { background: #e64a19; }
.fc-color-5 { border-left-color: #0288d1; } .fc-color-5 .fc-number { background: #0288d1; }
.fc-color-6 { border-left-color: #00796b; } .fc-color-6 .fc-number { background: #00796b; }
.fc-color-7 { border-left-color: #c62828; } .fc-color-7 .fc-number { background: #c62828; }
[dir="rtl"] .fc-color-1 { border-left: none; border-right-color: #1976d2; }
[dir="rtl"] .fc-color-2 { border-left: none; border-right-color: #388e3c; }
[dir="rtl"] .fc-color-3 { border-left: none; border-right-color: #7b1fa2; }
[dir="rtl"] .fc-color-4 { border-left: none; border-right-color: #e64a19; }
[dir="rtl"] .fc-color-5 { border-left: none; border-right-color: #0288d1; }
[dir="rtl"] .fc-color-6 { border-left: none; border-right-color: #00796b; }
[dir="rtl"] .fc-color-7 { border-left: none; border-right-color: #c62828; }

/* ---- FOLDER PAGE ---- */
.folder-header {
    display: flex;
    align-items: flex-start;
    gap: 20px;
    margin-bottom: 24px;
    background: var(--card-bg);
    padding: 20px 24px;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}
.folder-title-wrap h1 { font-size: 1.4rem; color: var(--primary); display: flex; align-items: center; gap: 10px; }
.fc-badge {
    background: var(--primary);
    color: #fff;
    padding: 4px 12px;
    border-radius: 6px;
    font-size: .9rem;
}
.folder-owner { color: var(--text-muted); margin-top: 4px; font-size: .9rem; }

/* ---- UPLOAD CARD ---- */
.upload-card {
    background: linear-gradient(135deg, #f8fbff, #edf4ff);
    border: 2px dashed var(--primary);
    border-radius: var(--radius);
    padding: 24px;
    margin-bottom: 24px;
}
.upload-card h3 { color: var(--primary); margin-bottom: 16px; }
.upload-row {
    display: flex;
    gap: 16px;
    align-items: flex-end;
    flex-wrap: wrap;
}
.flex-grow { flex: 1; min-width: 200px; }

/* ---- DOCS SECTION ---- */
.docs-section { background: var(--card-bg); border-radius: var(--radius); padding: 24px; box-shadow: var(--shadow); }
.docs-section h3 { margin-bottom: 16px; color: var(--primary); }
.empty-state { text-align: center; padding: 48px; color: var(--text-muted); font-size: 1.1rem; }

/* ---- TABLE ---- */
.table-wrap { overflow-x: auto; }
.data-table { width: 100%; border-collapse: collapse; font-size: .9rem; }
.data-table th {
    background: var(--primary);
    color: #fff;
    padding: 10px 14px;
    text-align: left;
    font-weight: 600;
    white-space: nowrap;
}
[dir="rtl"] .data-table th { text-align: right; }
.data-table td { padding: 10px 14px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.data-table tr:hover td { background: #f5f8ff; }
.data-table tr:last-child td { border-bottom: none; }
.row-inactive { opacity: .5; }
.nowrap { white-space: nowrap; }

/* ---- FORMS ---- */
.form-group { display: flex; flex-direction: column; gap: 4px; margin-bottom: 14px; }
.form-group label { font-size: .85rem; font-weight: 600; color: var(--text); }
.form-row {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
    align-items: flex-end;
}
input[type="text"], input[type="email"], input[type="password"], input[type="file"], select, textarea {
    width: 100%;
    padding: 9px 12px;
    border: 1.5px solid var(--border);
    border-radius: 7px;
    font-size: .9rem;
    font-family: inherit;
    background: #fafcff;
    transition: border-color var(--transition);
}
input:focus, select:focus, textarea:focus {
    border-color: var(--primary);
    outline: none;
    background: #fff;
}
.pw-wrap { position: relative; }
.pw-wrap input { padding-right: 40px; }
.pw-toggle {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1rem;
}

/* ---- BUTTONS ---- */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 9px 18px;
    border-radius: 7px;
    border: none;
    cursor: pointer;
    font-size: .9rem;
    font-family: inherit;
    font-weight: 600;
    text-decoration: none;
    transition: var(--transition);
    white-space: nowrap;
}
.btn-primary  { background: var(--primary); color: #fff; }
.btn-primary:hover { background: #0f2a47; }
.btn-secondary{ background: #e3edf8; color: var(--primary); }
.btn-secondary:hover { background: #ccddf5; }
.btn-danger   { background: #ffeaea; color: var(--danger); border: 1px solid #ffcdd2; }
.btn-danger:hover { background: var(--danger); color: #fff; }
.btn-ghost    { background: transparent; color: var(--text-muted); }
.btn-ghost:hover { background: var(--border); }
.btn-full     { width: 100%; justify-content: center; }
.btn-sm       { padding: 5px 12px; font-size: .82rem; }
.actions-cell { display: flex; gap: 6px; flex-wrap: wrap; }

/* ---- BADGES ---- */
.badge {
    background: var(--primary);
    color: #fff;
    padding: 2px 10px;
    border-radius: 20px;
    font-size: .78rem;
    font-weight: 600;
}
.badge-fc { background: #e3edf8; color: var(--primary); padding: 2px 8px; border-radius: 4px; font-size: .8rem; font-weight: 700; }
.badge-admin  { background: #7b1fa2; color: #fff; padding: 2px 8px; border-radius: 4px; font-size: .78rem; }
.badge-member { background: #388e3c; color: #fff; padding: 2px 8px; border-radius: 4px; font-size: .78rem; }
.fc-count { background: rgba(255,255,255,.3); color: var(--primary); border: 1px solid var(--border); }

/* ---- ALERTS ---- */
.alert {
    padding: 12px 18px;
    border-radius: var(--radius);
    margin-bottom: 16px;
    font-size: .9rem;
    font-weight: 500;
}
.alert-success { background: #e8f5e9; color: var(--success); border: 1px solid #a5d6a7; }
.alert-danger  { background: #ffebee; color: var(--danger);  border: 1px solid #ffcdd2; }
.alert-warning { background: #fff3e0; color: var(--warning); border: 1px solid #ffcc80; }

/* ---- CARD ---- */
.card {
    background: var(--card-bg);
    border-radius: var(--radius);
    padding: 24px;
    box-shadow: var(--shadow);
    margin-bottom: 24px;
}
.card h2 { color: var(--primary); margin-bottom: 20px; font-size: 1.15rem; }

/* ---- FILE LINK ---- */
.file-link {
    color: var(--primary);
    text-decoration: none;
    font-weight: 500;
}
.file-link:hover { text-decoration: underline; }

/* ---- MODAL ---- */
.modal {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 999;
}
.modal-box {
    background: #fff;
    border-radius: var(--radius);
    padding: 32px;
    width: 100%;
    max-width: 420px;
    box-shadow: 0 8px 32px rgba(0,0,0,.2);
}
.modal-box h3 { margin-bottom: 16px; color: var(--primary); }
.modal-actions { display: flex; gap: 12px; margin-top: 16px; }

/* ---- MISC ---- */
.text-muted { color: var(--text-muted); }
.text-green  { color: var(--success); font-weight: 600; }
.text-red    { color: var(--danger);  font-weight: 600; }
code { background: #f0f4f8; padding: 2px 6px; border-radius: 4px; font-size: .85em; }

/* ---- FOOTER ---- */
.site-footer {
    background: var(--primary);
    color: rgba(255,255,255,.7);
    text-align: center;
    padding: 16px;
    font-size: .85rem;
    margin-top: 40px;
}
.footer-sep { margin: 0 10px; }

/* ---- LANG SWITCHER (login) ---- */
.lang-switcher a { color: rgba(255,255,255,.8); text-decoration: none; padding: 0 6px; font-size: .9rem; }
.lang-switcher a.active { color: var(--accent); font-weight: 700; }

/* ---- RESPONSIVE ---- */
@media (max-width: 768px) {
    .nav-inner { flex-wrap: wrap; height: auto; padding: 12px; }
    .nav-links { display: none; }
    .fc-grid { grid-template-columns: 1fr 1fr; }
    .upload-row { flex-direction: column; }
    .form-row { flex-direction: column; }
    .folder-header { flex-direction: column; }
    .stats-bar { justify-content: center; }
}
@media (max-width: 480px) {
    .fc-grid { grid-template-columns: 1fr; }
    .container { padding: 16px; }
}
