/* =================================================================
   FONT & COLOR PALETTE
   ================================================================= */
:root {
    --primary-color: #007bff;
    --primary-hover-color: #0056b3;
    --dark-text-color: #333;
    --light-text-color: #666;
    --background-section-color: #f8f9fa;
    --card-border-color: #e9ecef;
    --danger-color: #dc3545;
    --success-color: #28a745;
    --warning-color: #ffc107;
    --muted-color: #6c757d;
    --radius-sm: 4px;
    --radius-md: 8px;
    --radius-lg: 12px;
    --radius-pill: 50px;
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.08);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 8px 30px rgba(0, 0, 0, 0.12);
    --transition-fast: 0.2s ease;
    --transition-normal: 0.3s ease;
}

/* =================================================================
   BASE
   ================================================================= */
*,
*::before,
*::after {
    box-sizing: border-box;
}

body {
    font-family: "Varela Round", sans-serif;
    font-optical-sizing: auto;
    font-style: normal;
    background-color: #F1F4F8;
    margin: 0;
    line-height: 1.6;
    color: var(--dark-text-color);
}

a {
    color: var(--primary-color);
    text-decoration: none;
    transition: color var(--transition-fast);
}

a:hover {
    color: var(--primary-hover-color);
}

/* =================================================================
   LAYOUT
   ================================================================= */
main::before {
    content: "";
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 200px;
    z-index: -1;
    background: linear-gradient(135deg, var(--primary-color), #0056b3);
}

main {
    max-width: 1200px;
    margin: 20px auto;
    padding: 10px;
    background-color: #fff;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 1rem;
    border-radius: var(--radius-lg);
}

/* =================================================================
   HEADER
   ================================================================= */
header {
    position: sticky;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1000;
    background: linear-gradient(135deg, var(--primary-color), #0056b3);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

header .container,
footer .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.site-logo {
    font-weight: bold;
    text-transform: uppercase;
    text-decoration: none;
    color: #F1F4F8;
    font-size: 32px;
    transition: opacity var(--transition-fast);
}

.site-logo:hover {
    opacity: 0.85;
    color: #F1F4F8;
}

header nav {
    display: flex;
    align-items: center;
    gap: 4px;
}

header nav a,
footer nav a {
    text-decoration: none;
    color: rgba(255, 255, 255, 0.85);
    padding: 6px 12px;
    border-radius: var(--radius-sm);
    transition: all var(--transition-fast);
    font-size: 0.95rem;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

header nav a:hover {
    color: #fff;
    background-color: rgba(255, 255, 255, 0.12);
}

/* =================================================================
   USER DROPDOWN MENU
   ================================================================= */
.user-dropdown {
    position: relative;
    display: inline-flex;
    align-items: center;
}

.user-dropdown-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: rgba(255, 255, 255, 0.9);
    padding: 6px 14px;
    border-radius: var(--radius-pill);
    cursor: pointer;
    font-family: inherit;
    font-size: 0.9rem;
    transition: all var(--transition-fast);
    white-space: nowrap;
}

.user-dropdown-btn:hover {
    background: rgba(255, 255, 255, 0.18);
    color: #fff;
}

.user-chevron {
    transition: transform var(--transition-fast);
    opacity: 0.7;
    flex-shrink: 0;
}

.user-dropdown:hover .user-chevron,
.user-dropdown.open .user-chevron {
    transform: rotate(180deg);
    opacity: 1;
}

.user-dropdown-menu {
    position: absolute;
    top: 100%;
    right: 0;
    min-width: 210px;
    background: #fff;
    border-radius: var(--radius-md);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.15), 0 2px 8px rgba(0, 0, 0, 0.06);
    padding: 6px 0;
    padding-top: 12px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-4px);
    transition: all 0.2s ease;
    z-index: 2000;
    pointer-events: none;
}

/* Invisible bridge to maintain hover when moving mouse from button to menu */
.user-dropdown-menu::before {
    content: "";
    position: absolute;
    top: -10px;
    left: 0;
    right: 0;
    height: 10px;
}

.user-dropdown:hover .user-dropdown-menu,
.user-dropdown.open .user-dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
    pointer-events: auto;
}

.user-dropdown-menu a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 16px;
    color: var(--dark-text-color);
    font-size: 0.9rem;
    text-decoration: none;
    transition: all var(--transition-fast);
    border-radius: 0;
}

.user-dropdown-menu a:hover {
    background-color: var(--background-section-color);
    color: var(--primary-color);
}

.user-dropdown-menu a i[data-lucide] {
    color: var(--muted-color);
    flex-shrink: 0;
    transition: color var(--transition-fast);
}

.user-dropdown-menu a:hover i[data-lucide] {
    color: var(--primary-color);
}

.user-dropdown-divider {
    height: 1px;
    background: var(--card-border-color);
    margin: 4px 12px;
}

.user-dropdown-logout:hover {
    color: var(--danger-color) !important;
}

.user-dropdown-logout:hover i[data-lucide] {
    color: var(--danger-color) !important;
}

/* =================================================================
   FOOTER
   ================================================================= */
footer {
    background-color: #2c3e50;
    color: rgba(255, 255, 255, 0.7);
    margin-top: 0;
}

footer .container {
    padding: 1.2rem 1rem;
}

footer p {
    margin: 0;
    font-size: 0.9rem;
}

footer nav a {
    color: rgba(255, 255, 255, 0.6);
    font-size: 0.85rem;
}

footer nav a:hover {
    color: #fff;
    background: none;
}

/* =================================================================
   UNIFIED MODAL SYSTEM
   ================================================================= */
.modal-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    z-index: 9998;
    opacity: 0;
    transition: opacity var(--transition-normal);
    pointer-events: none;
}

.modal-backdrop.active {
    opacity: 1;
    pointer-events: auto;
}

.modal {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.95);
    background: #fff;
    border-radius: var(--radius-lg);
    z-index: 9999;
    min-width: 360px;
    max-width: 480px;
    width: 90%;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
    opacity: 0;
    transition: all var(--transition-normal);
    pointer-events: none;
    overflow: hidden;
}

.modal.active {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
    pointer-events: auto;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--card-border-color);
}

.modal-header h4 {
    margin: 0;
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--dark-text-color);
}

.modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--muted-color);
    cursor: pointer;
    padding: 0;
    line-height: 1;
    transition: all var(--transition-fast);
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-sm);
}

.modal-close:hover {
    color: var(--danger-color);
    background-color: rgba(220, 53, 69, 0.08);
}

.modal-body {
    padding: 1.5rem;
}

.modal-footer {
    padding: 1rem 1.5rem;
    border-top: 1px solid var(--card-border-color);
    display: flex;
    justify-content: flex-end;
    gap: 8px;
}

/* Modal form styles */
.modal-body input[type="email"],
.modal-body input[type="password"],
.modal-body input[type="text"],
.modal-body select {
    display: block;
    width: 100%;
    padding: 10px 12px;
    margin-bottom: 12px;
    border: 1px solid #ddd;
    border-radius: var(--radius-md);
    font-size: 0.95rem;
    font-family: inherit;
    transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
    outline: none;
}

.modal-body input:focus,
.modal-body select:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.15);
}

.modal-body .captcha-img {
    border: 1px solid #ddd;
    border-radius: var(--radius-sm);
    margin: 8px 0;
}

.modal-body .btn {
    width: 100%;
}

.modal-body p {
    margin-top: 16px;
    font-size: 0.9em;
    text-align: center;
    color: var(--light-text-color);
}

.modal-body p a {
    font-weight: 500;
}

.error-message {
    color: var(--danger-color);
    margin-bottom: 10px;
    font-size: 0.9em;
    padding: 8px 12px;
    background-color: rgba(220, 53, 69, 0.06);
    border-radius: var(--radius-sm);
    display: none;
}

.error-message:not(:empty) {
    display: block;
}

/* Legacy modal classes used inline — keep for backward compat */
.hidden {
    display: none !important;
}

/* =================================================================
   BUTTONS
   ================================================================= */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 8px 16px;
    border: none;
    border-radius: var(--radius-md);
    color: white;
    cursor: pointer;
    font-family: inherit;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all var(--transition-fast);
    text-decoration: none;
    line-height: 1.4;
}

.btn:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow-sm);
}

.btn:active {
    transform: translateY(0);
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.btn-blue {
    background-color: var(--primary-color);
}

.btn-blue:hover {
    background-color: var(--primary-hover-color);
}

.btn-yellow {
    background-color: var(--warning-color);
    color: #212529;
}

.btn-yellow:hover {
    background-color: #e0a800;
}

.btn-red {
    background-color: var(--danger-color);
}

.btn-red:hover {
    background-color: #c82333;
}

.btn-green {
    background-color: var(--success-color);
}

.btn-green:hover {
    background-color: #218838;
}

.btn-secondary {
    background-color: var(--muted-color);
}

.btn-secondary:hover {
    background-color: #5a6268;
}

.btn-small {
    font-size: 0.8em;
    padding: 5px 10px;
}

/* =================================================================
   FORM ELEMENTS
   ================================================================= */
.form-group {
    margin-bottom: 15px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: 500;
    font-size: 0.95rem;
    color: var(--dark-text-color);
}

.form-group input,
.form-group select {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #ddd;
    border-radius: var(--radius-md);
    font-family: inherit;
    font-size: 0.95rem;
    transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
    outline: none;
}

.form-group input:focus,
.form-group select:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.15);
}

/* =================================================================
   GENERAL SECTION STYLING (Homepage)
   ================================================================= */
.hero-section,
.features-section,
.global-network-section,
.monetization-section,
.supported-files-section,
.final-cta-section {
    padding: 3rem 1rem;
    text-align: center;
    border-bottom: 1px solid var(--card-border-color);
}

.features-section,
.global-network-section,
.supported-files-section {
    margin: 2rem 0;
}

.final-cta-section,
.hero-section {
    border-bottom: none;
}

.section-title {
    font-size: 2.2rem;
    color: var(--dark-text-color);
    margin-bottom: 1rem;
}

.section-description {
    font-size: 1.1rem;
    color: var(--light-text-color);
    max-width: 800px;
    margin: 0 auto 2rem auto;
}

/* === HERO SECTION === */
.hero-section {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.8), rgba(240, 245, 255, 0.8));
    border-radius: var(--radius-md);
    margin-bottom: 2rem;
}

.hero-content h1 {
    font-size: 3.5rem;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 0.5rem;
}

.hero-content .subtitle {
    font-size: 1.4rem;
    color: var(--light-text-color);
    margin-bottom: 2rem;
}

.cta-button {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background-color: var(--primary-color);
    color: #fff;
    padding: 12px 28px;
    font-size: 1.1rem;
    font-weight: bold;
    text-decoration: none;
    border-radius: var(--radius-pill);
    transition: all var(--transition-normal);
    border: none;
    cursor: pointer;
}

.cta-button:hover {
    background-color: var(--primary-hover-color);
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(0, 123, 255, 0.35);
    color: #fff;
}

.cta-button-large {
    padding: 15px 35px;
    font-size: 1.2rem;
}

/* === FEATURES & MONETIZATION SECTION === */
.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
    margin-top: 3rem;
}

.feature-card {
    background-color: #fff;
    padding: 2rem;
    border-radius: var(--radius-lg);
    border: 1px solid var(--card-border-color);
    transition: all var(--transition-normal);
}

.feature-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.08);
    border-color: rgba(0, 123, 255, 0.2);
}

.feature-icon {
    color: var(--primary-color);
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 64px;
    height: 64px;
    background: rgba(0, 123, 255, 0.08);
    border-radius: var(--radius-md);
    margin-left: auto;
    margin-right: auto;
}

.feature-card h3 {
    font-size: 1.5rem;
    color: var(--dark-text-color);
    margin-bottom: 0.75rem;
}

.feature-card p {
    font-size: 1rem;
    color: var(--light-text-color);
    line-height: 1.6;
}

.monetization-section {
    background-color: var(--background-section-color);
    border-radius: var(--radius-md);
}

/* === GLOBAL NETWORK SECTION === */
.global-map-image {
    max-width: 100%;
    height: auto;
    border-radius: var(--radius-lg);
    margin-top: 1rem;
    box-shadow: var(--shadow-md);
    object-fit: cover;
    max-height: 450px;
}

/* === SUPPORTED FILES SECTION === */
.supported-files-section {
    background-color: var(--background-section-color);
    border-radius: var(--radius-md);
}

.file-icons-grid {
    display: flex;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    gap: 1.5rem;
    margin-top: 2rem;
}

.file-type-icon {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 16px;
    border-radius: var(--radius-md);
    transition: all var(--transition-normal);
    cursor: default;
    color: var(--primary-color);
}

.file-type-icon:hover {
    transform: translateY(-4px);
    background-color: rgba(0, 123, 255, 0.06);
}

.file-type-icon span {
    font-size: 0.8rem;
    color: var(--light-text-color);
    font-weight: 500;
}

/* === FINAL CTA SECTION === */
.final-cta-section h2 {
    font-size: 2rem;
    margin-bottom: 1.5rem;
    color: var(--dark-text-color);
}

/* =================================================================
   SETTINGS LAYOUT (consolidated from inline styles)
   ================================================================= */
.settings-layout {
    display: flex;
    gap: 30px;
}

.settings-sidebar {
    flex: 0 0 200px;
}

.settings-sidebar a {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 12px;
    text-decoration: none;
    color: var(--dark-text-color);
    border-left: 3px solid transparent;
    transition: all var(--transition-fast);
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
    font-size: 0.95rem;
}

.settings-sidebar a:hover {
    background-color: var(--background-section-color);
    color: var(--primary-color);
}

.settings-sidebar a.active {
    border-left-color: var(--primary-color);
    font-weight: bold;
    color: var(--primary-color);
    background-color: rgba(0, 123, 255, 0.05);
}

.settings-content {
    flex-grow: 1;
}

/* Session items */
.session-item {
    padding: 12px 16px;
    border: 1px solid var(--card-border-color);
    border-radius: var(--radius-md);
    margin-bottom: 10px;
    transition: border-color var(--transition-fast);
}

.session-item:hover {
    border-color: #ccc;
}

.session-item p {
    margin: 4px 0;
    font-size: 0.9rem;
}

/* =================================================================
   FILE VIEW PAGE (/d/ route)
   ================================================================= */
.fv-view-page {
    max-width: 860px;
    margin: 30px auto;
    padding: 0 20px;
}

/* --- Preview Section --- */
.fv-player-wrap {
    position: relative;
    padding-bottom: 56.25%;
    /* 16:9 */
    height: 0;
    background: #000;
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.15);
}

.fv-player-wrap iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: none;
}

.fv-image-wrap {
    text-align: center;
    background: #f5f5f5;
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.1);
}

.fv-image-wrap img {
    max-width: 100%;
    max-height: 70vh;
    object-fit: contain;
    cursor: zoom-in;
    transition: transform 0.2s;
}

.fv-image-wrap img:hover {
    transform: scale(1.01);
}

.fv-file-icon-wrap {
    text-align: center;
    padding: 60px 20px;
    background: var(--background-section-color);
    border-radius: var(--radius-lg);
}

/* --- Info Card --- */
.fv-info-card {
    margin-top: 24px;
    padding: 24px;
    background: #fff;
    border: 1px solid var(--card-border-color);
    border-radius: var(--radius-lg);
}

.fv-filename {
    font-size: 1.4rem;
    font-weight: 600;
    color: var(--dark-text-color);
    margin: 0 0 12px 0;
    word-break: break-word;
}

.fv-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    margin-bottom: 20px;
}

.fv-meta span {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 0.9rem;
    color: var(--light-text-color);
    background: var(--background-section-color);
    padding: 4px 10px;
    border-radius: var(--radius-pill);
}

.fv-actions {
    display: flex;
    gap: 10px;
    align-items: center;
}

.download-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 28px;
    background-color: var(--primary-color);
    color: white;
    text-decoration: none;
    border-radius: var(--radius-md);
    font-size: 1.1em;
    font-weight: 500;
    font-family: inherit;
    cursor: pointer;
    border: none;
    transition: all var(--transition-normal);
}

.download-btn:hover {
    background-color: var(--primary-hover-color);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 123, 255, 0.3);
}

.download-btn.loading {
    background-color: var(--muted-color);
    pointer-events: none;
}

.download-error {
    color: var(--danger-color);
    margin-top: 15px;
    display: none;
}

/* --- Embed Codes --- */
.fv-embed-section {
    margin-top: 24px;
    padding: 24px;
    background: #fff;
    border: 1px solid var(--card-border-color);
    border-radius: var(--radius-lg);
}

.fv-embed-section h3 {
    font-size: 1.1rem;
    margin-bottom: 16px;
    color: var(--dark-text-color);
}

.fv-code-group {
    margin-bottom: 14px;
}

.fv-code-group label {
    display: block;
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--light-text-color);
    margin-bottom: 5px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.fv-code-box {
    display: flex;
    align-items: center;
    background: #f6f8fa;
    border: 1px solid #e1e4e8;
    border-radius: var(--radius-sm);
    overflow: hidden;
}

.fv-code-box code {
    flex: 1;
    padding: 10px 12px;
    font-family: 'Courier New', monospace;
    font-size: 0.82rem;
    color: #24292e;
    white-space: nowrap;
    overflow-x: auto;
    line-height: 1.5;
}

.fv-copy-btn {
    flex-shrink: 0;
    padding: 10px 12px;
    background: transparent;
    border: none;
    border-left: 1px solid #e1e4e8;
    cursor: pointer;
    color: var(--muted-color);
    transition: all var(--transition-fast);
    display: inline-flex;
    align-items: center;
}

.fv-copy-btn:hover {
    background: #eef1f5;
    color: var(--primary-color);
}

@media (max-width: 600px) {
    .fv-view-page {
        padding: 0 12px;
    }

    .fv-filename {
        font-size: 1.1rem;
    }

    .fv-meta {
        gap: 8px;
    }

    .fv-meta span {
        font-size: 0.8rem;
        padding: 3px 8px;
    }

    .fv-code-box code {
        font-size: 0.75rem;
    }
}

/* --- Share Buttons --- */
.fv-share {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid var(--card-border-color);
    flex-wrap: wrap;
}

.fv-share-label {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--light-text-color);
    margin-right: 4px;
}

.fv-share-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: none;
    cursor: pointer;
    transition: all var(--transition-fast);
    color: #fff;
    text-decoration: none;
}

.fv-share-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.fv-share-fb {
    background: #1877F2;
}

.fv-share-x {
    background: #000;
}

.fv-share-tg {
    background: #0088cc;
}

.fv-share-rd {
    background: #FF4500;
}

.fv-share-pin {
    background: #E60023;
}

.fv-share-copy {
    background: var(--muted-color);
    color: #fff;
}

/* =================================================================
   FILE MANAGER (consolidated from inline styles)
   ================================================================= */
.file-manager-container {
    max-width: 1200px;
    margin: 20px auto;
    padding: 0 15px;
    font-size: 14px;
}

h3,
h4 {
    margin-top: 0;
    margin-bottom: 15px;
    font-weight: 600;
}

h3 {
    font-size: 1.5em;
}

h4 {
    font-size: 1.2em;
}

/* --- Sections --- */
.upload-section,
.new-folder-section {
    margin-bottom: 20px;
    padding: 20px;
    border: 1px solid var(--card-border-color);
    border-radius: var(--radius-md);
    background-color: #fdfdfd;
}

.new-folder-section {
    display: flex;
    gap: 10px;
}

.new-folder-section input {
    flex-grow: 1;
}

/* --- File Table --- */
.file-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 20px;
    table-layout: fixed;
}

.file-table th,
.file-table td {
    padding: 12px 10px;
    border-bottom: 1px solid var(--card-border-color);
    text-align: left;
    vertical-align: middle;
    word-wrap: break-word;
}

.file-table th:nth-child(2),
.file-table td:nth-child(2) {
    width: 40%;
}

.file-table th:nth-child(3),
.file-table td:nth-child(3) {
    width: 15%;
}

.file-table th:nth-child(4),
.file-table td:nth-child(4) {
    width: 15%;
}

.file-table th:nth-child(5),
.file-table td:nth-child(5) {
    width: 10%;
    text-align: center;
}

.file-table th:nth-child(6),
.file-table td:nth-child(6) {
    width: 20%;
}

.file-table thead th {
    background-color: var(--background-section-color);
    color: #495057;
    font-weight: 600;
}

.file-table tbody tr {
    transition: background-color var(--transition-fast);
}

.file-table tbody tr:hover {
    background-color: #f8f9fb;
}

.file-table a {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 500;
}

.file-table a:hover {
    text-decoration: underline;
}

/* File name with icon */
.file-name-cell {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.file-name-cell .lucide {
    flex-shrink: 0;
}

/* --- Filter Row --- */
.filter-row td {
    padding: 10px;
    background-color: #fff;
    border-bottom: 2px solid #dee2e6;
    position: relative;
}

.filter-input,
.filter-select {
    width: 100%;
    padding: 8px 10px;
    border: 1px solid #ddd;
    border-radius: var(--radius-sm);
    box-sizing: border-box;
    font-size: 0.9em;
    font-family: inherit;
    outline: none;
    transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.filter-input:focus,
.filter-select:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.1);
}

.size-filter-group {
    display: flex;
    align-items: center;
    gap: 5px;
}

.size-slider {
    display: none;
    position: absolute;
    width: 95%;
    top: 100%;
    left: 2.5%;
    padding: 15px 10px;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-md);
    z-index: 10;
    margin-top: 5px;
}

.noUi-horizontal .noUi-handle {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: var(--primary-color);
    cursor: grab;
    top: -5px;
    box-shadow: none;
    border: none;
}

.noUi-horizontal .noUi-handle::after,
.noUi-horizontal .noUi-handle::before {
    display: none;
}

/* --- Upload UI --- */
.dropzone {
    border: 2px dashed #d0d5dd;
    padding: 24px;
    text-align: center;
    cursor: pointer;
    border-radius: var(--radius-md);
    margin-bottom: 15px;
    transition: all var(--transition-normal);
    color: var(--light-text-color);
    font-size: 0.95rem;
}

.dropzone:hover,
.dropzone.dragover {
    border-color: var(--primary-color);
    background: rgba(0, 123, 255, 0.03);
    color: var(--primary-color);
}

.upload-controls,
.upload-options {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 15px;
    flex-wrap: wrap;
}

.upload-options {
    margin-left: auto;
}

.file-list {
    border: 1px solid var(--card-border-color);
    border-radius: var(--radius-sm);
    padding: 10px;
    min-height: 50px;
    max-height: 200px;
    overflow-y: auto;
    background-color: #fff;
}

.file-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px;
    border-bottom: 1px solid #f0f0f0;
}

.file-item:last-child {
    border-bottom: none;
}

.file-info {
    flex-grow: 1;
    margin-right: 10px;
    font-size: 0.9em;
}

.file-info .status {
    font-size: 0.8em;
    color: var(--muted-color);
}

.progress-bar-container {
    width: 200px;
    height: 12px;
    background: #e9ecef;
    border-radius: 6px;
    position: relative;
    display: flex;
    align-items: center;
    overflow: hidden;
}

.progress {
    height: 100%;
    background: linear-gradient(90deg, var(--primary-color), #4da3ff);
    border-radius: 6px;
    transition: width 0.15s ease;
}

.progress-text {
    position: absolute;
    width: 100%;
    text-align: center;
    color: var(--dark-text-color);
    font-size: 0.75em;
    font-weight: bold;
}

/* --- Public Toggle --- */
.public-toggle-icon {
    cursor: pointer;
    transition: all var(--transition-fast);
    opacity: 0.4;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: var(--radius-sm);
}

.public-toggle-icon:hover {
    opacity: 0.8;
    background-color: rgba(0, 0, 0, 0.04);
}

.public-toggle-icon.is-public {
    color: var(--success-color);
    opacity: 1;
}

/* --- Breadcrumb --- */
.breadcrumb {
    display: flex;
    gap: 5px;
    margin-bottom: 20px;
    align-items: center;
    flex-wrap: wrap;
}

.breadcrumb a {
    color: var(--primary-color);
    text-decoration: none;
    font-size: 0.95rem;
}

.breadcrumb a:hover {
    text-decoration: underline;
}

.breadcrumb span {
    color: var(--muted-color);
}

/* --- Pagination --- */
.pagination-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 20px;
}

.page-nav {
    display: flex;
    align-items: center;
    gap: 10px;
}

.page-nav span {
    font-size: 0.9rem;
    color: var(--muted-color);
}

/* --- Bulk Actions --- */
.bulk-actions-footer {
    display: flex;
    align-items: center;
    gap: 10px;
}

/* =================================================================
   RESPONSIVE
   ================================================================= */
@media (max-width: 768px) {
    .settings-layout {
        flex-direction: column;
    }

    .settings-sidebar {
        flex: none;
    }

    .hero-content h1 {
        font-size: 2.5rem;
    }

    .hero-content .subtitle {
        font-size: 1.1rem;
    }

    .section-title {
        font-size: 1.8rem;
    }

    .features-grid {
        grid-template-columns: 1fr;
    }

    header nav {
        gap: 0;
    }

    header nav a {
        padding: 6px 8px;
        font-size: 0.85rem;
    }

    .file-table {
        font-size: 0.85em;
    }

    .news-layout {
        flex-direction: column;
    }

    .news-sidebar {
        flex: none;
        width: 100%;
        position: static;
    }

    .news-card {
        flex-direction: column;
    }

    .news-card-image {
        width: 100%;
        height: 200px;
    }
}

/* =================================================================
   NEWS PAGE
   ================================================================= */
.news-layout {
    display: flex;
    gap: 2rem;
    align-items: flex-start;
    padding-top: 1.5rem;
    padding-bottom: 2rem;
}

/* --- Sidebar --- */
.news-sidebar {
    flex: 0 0 260px;
    position: sticky;
    top: 80px;
    background: var(--background-section-color);
    border-radius: var(--radius-lg);
    padding: 1.25rem;
    border: 1px solid var(--card-border-color);
}

.news-sidebar h3 {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 1.1rem;
    margin-bottom: 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--card-border-color);
    color: var(--dark-text-color);
}

.archive-tree {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.archive-year {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 10px;
    border-radius: var(--radius-sm);
    color: var(--dark-text-color);
    font-weight: 600;
    font-size: 0.95rem;
    text-decoration: none;
    transition: all var(--transition-fast);
}

.archive-year:hover {
    background-color: rgba(0, 123, 255, 0.06);
    color: var(--primary-color);
}

.archive-year.is-active {
    background-color: rgba(0, 123, 255, 0.1);
    color: var(--primary-color);
}

.archive-chevron {
    transition: transform var(--transition-fast);
    flex-shrink: 0;
}

.archive-year-group.is-open .archive-chevron {
    transform: rotate(90deg);
}

.archive-count {
    margin-left: auto;
    background: rgba(0, 123, 255, 0.1);
    color: var(--primary-color);
    padding: 1px 8px;
    border-radius: var(--radius-pill);
    font-size: 0.8rem;
    font-weight: 600;
    min-width: 24px;
    text-align: center;
}

.archive-months {
    display: none;
    flex-direction: column;
    padding-left: 24px;
}

.archive-year-group.is-open .archive-months {
    display: flex;
}

.archive-month {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 10px;
    border-radius: var(--radius-sm);
    color: var(--light-text-color);
    font-size: 0.9rem;
    text-decoration: none;
    transition: all var(--transition-fast);
}

.archive-month:hover {
    background-color: rgba(0, 123, 255, 0.06);
    color: var(--primary-color);
}

.archive-month.is-active {
    background-color: rgba(0, 123, 255, 0.1);
    color: var(--primary-color);
    font-weight: 600;
}

.archive-month .archive-count {
    font-size: 0.75rem;
    padding: 0 6px;
}

.archive-empty {
    color: var(--muted-color);
    font-size: 0.9rem;
    text-align: center;
    padding: 1rem 0;
}

/* --- News Content Area --- */
.news-content {
    flex: 1;
    min-width: 0;
}

.news-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid var(--card-border-color);
}

.news-header h1 {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.6rem;
    margin: 0;
    color: var(--dark-text-color);
}

.news-back-link {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 0.9rem;
    color: var(--primary-color);
    text-decoration: none;
    padding: 6px 12px;
    border-radius: var(--radius-sm);
    transition: all var(--transition-fast);
    white-space: nowrap;
}

.news-back-link:hover {
    background-color: rgba(0, 123, 255, 0.06);
}

/* --- News Cards --- */
.news-list {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.news-card {
    display: flex;
    background: #fff;
    border: 1px solid var(--card-border-color);
    border-radius: var(--radius-lg);
    overflow: hidden;
    transition: all var(--transition-normal);
}

.news-card:hover {
    border-color: rgba(0, 123, 255, 0.25);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.06);
    transform: translateY(-2px);
}

.news-card-image {
    flex: 0 0 240px;
    overflow: hidden;
}

.news-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform var(--transition-normal);
}

.news-card:hover .news-card-image img {
    transform: scale(1.05);
}

.news-card-body {
    flex: 1;
    padding: 1.25rem 1.5rem;
    display: flex;
    flex-direction: column;
}

.news-card-meta {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 0.5rem;
}

.news-card-meta time {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 0.8rem;
    color: var(--muted-color);
}

.news-card-title {
    font-size: 1.2rem;
    margin: 0 0 0.5rem 0;
    line-height: 1.4;
}

.news-card-title a {
    color: var(--dark-text-color);
    text-decoration: none;
    transition: color var(--transition-fast);
}

.news-card-title a:hover {
    color: var(--primary-color);
}

.news-card-excerpt {
    color: var(--light-text-color);
    font-size: 0.95rem;
    line-height: 1.6;
    margin: 0 0 0.75rem 0;
    flex: 1;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.news-read-more {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 0.9rem;
    color: var(--primary-color);
    font-weight: 500;
    text-decoration: none;
    transition: gap var(--transition-fast);
}

.news-read-more:hover {
    gap: 8px;
}

/* --- Pagination --- */
.news-pagination {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--card-border-color);
}

.news-pagination-info {
    font-size: 0.85rem;
    color: var(--muted-color);
}

.news-pagination-controls {
    display: flex;
    align-items: center;
    gap: 4px;
}

.pagination-btn {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 6px 12px;
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    color: var(--dark-text-color);
    text-decoration: none;
    transition: all var(--transition-fast);
    border: 1px solid var(--card-border-color);
}

.pagination-btn:hover {
    background-color: rgba(0, 123, 255, 0.06);
    border-color: var(--primary-color);
    color: var(--primary-color);
}

.pagination-btn.is-active {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
    color: #fff;
    font-weight: 600;
}

.news-page-size {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.85rem;
    color: var(--muted-color);
}

.news-page-size select {
    padding: 4px 8px;
    border: 1px solid var(--card-border-color);
    border-radius: var(--radius-sm);
    font-family: inherit;
    font-size: 0.85rem;
    outline: none;
    cursor: pointer;
    transition: border-color var(--transition-fast);
}

.news-page-size select:focus {
    border-color: var(--primary-color);
}

/* --- Empty State --- */
.news-empty {
    text-align: center;
    padding: 4rem 2rem;
    color: var(--muted-color);
}

.news-empty i {
    margin-bottom: 1rem;
    opacity: 0.4;
}

.news-empty p {
    font-size: 1.1rem;
}

/* --- News Detail Article --- */
.news-detail-article {
    background: #fff;
    border: 1px solid var(--card-border-color);
    border-radius: var(--radius-lg);
    overflow: hidden;
}

.news-detail-hero {
    width: 100%;
    max-height: 420px;
    overflow: hidden;
}

.news-detail-hero img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.news-detail-title {
    font-size: 2rem;
    line-height: 1.3;
    margin: 0 0 0.75rem 0;
    color: var(--dark-text-color);
    padding: 1.5rem 2rem 0;
}

.news-detail-meta {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 0 2rem 1.25rem;
    border-bottom: 1px solid var(--card-border-color);
}

.news-detail-date {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.9rem;
    color: var(--muted-color);
}

.news-detail-body {
    padding: 2rem;
    font-size: 1.05rem;
    line-height: 1.8;
    color: var(--dark-text-color);
}

.news-detail-body h2,
.news-detail-body h3,
.news-detail-body h4 {
    margin-top: 1.5rem;
    margin-bottom: 0.75rem;
}

.news-detail-body p {
    margin-bottom: 1rem;
}

.news-detail-body img {
    max-width: 100%;
    height: auto;
    border-radius: var(--radius-md);
    margin: 1rem 0;
}

.news-detail-body ul,
.news-detail-body ol {
    padding-left: 1.5rem;
    margin-bottom: 1rem;
}

.news-detail-body blockquote {
    margin: 1rem 0;
    padding: 1rem 1.5rem;
    border-left: 4px solid var(--primary-color);
    background: var(--background-section-color);
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
    color: var(--light-text-color);
}

.news-detail-body pre {
    background: #2c3e50;
    color: #ecf0f1;
    padding: 1rem 1.5rem;
    border-radius: var(--radius-md);
    overflow-x: auto;
    margin: 1rem 0;
}

.news-detail-body code {
    background: var(--background-section-color);
    padding: 2px 6px;
    border-radius: var(--radius-sm);
    font-size: 0.9em;
}

.news-detail-body pre code {
    background: none;
    padding: 0;
}

/* === Page Article === */
.page-article {
    max-width: 800px;
    margin: 40px auto;
    padding: 0 20px;
}

.page-article-title {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 24px;
    color: var(--primary-text-color);
    line-height: 1.3;
}

.page-article-content {
    font-size: 1rem;
    line-height: 1.8;
    color: var(--secondary-text-color);
}

.page-article-content h2 {
    font-size: 1.5rem;
    margin: 28px 0 12px;
    color: var(--primary-text-color);
}

.page-article-content h3 {
    font-size: 1.25rem;
    margin: 24px 0 10px;
    color: var(--primary-text-color);
}

.page-article-content h4 {
    font-size: 1.1rem;
    margin: 20px 0 8px;
    color: var(--primary-text-color);
}

.page-article-content p {
    margin: 0 0 16px;
}

.page-article-content ul,
.page-article-content ol {
    margin: 0 0 16px 24px;
}

.page-article-content li {
    margin-bottom: 6px;
}

.page-article-content img {
    max-width: 100%;
    border-radius: 8px;
    margin: 16px 0;
}

.page-article-content a {
    color: var(--link-color);
    text-decoration: underline;
}

.page-article-content blockquote {
    border-left: 3px solid var(--link-color);
    margin: 16px 0;
    padding: 8px 16px;
    background: var(--background-section-color);
    border-radius: 0 6px 6px 0;
}

.page-article-content pre {
    background: var(--background-section-color);
    padding: 16px;
    border-radius: 8px;
    overflow-x: auto;
    margin: 16px 0;
}

.page-article-content code {
    background: var(--background-section-color);
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.9em;
}

/* === Support Pages === */
.support-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 32px;
    margin: 32px 0;
}

.support-card {
    background: var(--background-section-color);
    border-radius: 12px;
    padding: 24px;
    border: 1px solid var(--border-color);
}

.support-card-title {
    font-size: 1.2rem;
    font-weight: 700;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.support-form-group {
    margin-bottom: 14px;
}

.support-form-group label {
    display: block;
    font-weight: 600;
    font-size: 13px;
    margin-bottom: 4px;
    color: var(--secondary-text-color);
}

.support-form-group select,
.support-form-group input[type="text"],
.support-form-group textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background: var(--background-main-color);
    color: var(--primary-text-color);
    font-family: inherit;
    font-size: 14px;
    transition: border-color 0.2s;
}

.support-form-group select:focus,
.support-form-group input:focus,
.support-form-group textarea:focus {
    outline: none;
    border-color: var(--link-color);
}

.support-form-group textarea {
    resize: vertical;
    min-height: 100px;
}

.support-form-group input[type="file"] {
    font-size: 13px;
}

.support-submit-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 20px;
    background: var(--link-color);
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: opacity 0.2s;
}

.support-submit-btn:hover {
    opacity: 0.9;
}

.support-result {
    margin-top: 12px;
}

.support-success {
    padding: 12px 16px;
    background: rgba(34, 197, 94, 0.1);
    border: 1px solid rgba(34, 197, 94, 0.3);
    border-radius: 8px;
    color: #22c55e;
    font-size: 14px;
    line-height: 1.6;
}

.support-section-title {
    font-size: 1.2rem;
    font-weight: 700;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.support-tickets-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.support-ticket-item {
    display: block;
    padding: 14px 16px;
    background: var(--background-section-color);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    text-decoration: none;
    color: var(--primary-text-color);
    transition: all 0.2s;
}

.support-ticket-item:hover {
    border-color: var(--link-color);
    transform: translateY(-1px);
}

.support-ticket-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 6px;
}

.support-ticket-uid {
    font-family: 'Consolas', 'Monaco', monospace;
    font-size: 12px;
    color: var(--secondary-text-color);
}

.support-ticket-title {
    font-weight: 600;
    font-size: 15px;
    margin-bottom: 6px;
}

.support-ticket-meta {
    display: flex;
    gap: 12px;
    font-size: 12px;
    color: var(--secondary-text-color);
}

.support-ticket-cat {
    text-transform: capitalize;
}

.support-ticket-status {
    display: inline-block;
    padding: 2px 10px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
}

.support-status-new {
    background: rgba(99, 102, 241, 0.15);
    color: #818cf8;
}

.support-status-wait_client {
    background: rgba(234, 179, 8, 0.15);
    color: #eab308;
}

.support-status-client_responded {
    background: rgba(34, 197, 94, 0.15);
    color: #22c55e;
}

.support-status-closed {
    background: rgba(107, 114, 128, 0.15);
    color: #9ca3af;
}

.support-empty {
    text-align: center;
    padding: 40px;
    color: var(--secondary-text-color);
}

.support-empty p {
    margin-top: 8px;
}

/* Support Detail */
.support-detail-page {
    max-width: 800px;
    margin: 32px auto;
    padding: 0 16px;
}

.support-back-link {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    color: var(--link-color);
    text-decoration: none;
    font-size: 13px;
    margin-bottom: 12px;
}

.support-detail-title {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 8px;
}

.support-detail-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
    margin-bottom: 20px;
}

.support-thread {
    margin-bottom: 24px;
}

.support-message {
    padding: 12px 16px;
    border-radius: 10px;
    margin-bottom: 10px;
}

.support-msg-client {
    background: var(--background-section-color);
    border-left: 3px solid var(--link-color);
}

.support-msg-admin {
    background: rgba(99, 102, 241, 0.06);
    border-right: 3px solid var(--link-color);
    text-align: right;
}

.support-msg-label {
    font-size: 12px;
    font-weight: 600;
    margin-bottom: 4px;
    color: var(--secondary-text-color);
}

.support-msg-content {
    font-size: 14px;
    line-height: 1.6;
    white-space: pre-wrap;
}

.support-msg-meta {
    font-size: 11px;
    color: var(--secondary-text-color);
    margin-top: 6px;
}

.support-msg-attachment {
    margin-top: 6px;
    font-size: 12px;
}

.support-msg-attachment a {
    color: var(--link-color);
}

.support-reply-form {
    border-top: 1px solid var(--border-color);
    padding-top: 16px;
}

.support-reply-form h3 {
    font-size: 1rem;
    margin-bottom: 10px;
}

.support-reply-form textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background: var(--background-main-color);
    color: var(--primary-text-color);
    font-family: inherit;
    font-size: 14px;
    resize: vertical;
    min-height: 80px;
}

.support-reply-form textarea:focus {
    outline: none;
    border-color: var(--link-color);
}

.support-reply-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 10px;
}

.support-closed-notice {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 16px;
    margin-top: 16px;
    background: rgba(107, 114, 128, 0.1);
    border-radius: 8px;
    color: var(--secondary-text-color);
    font-size: 14px;
}

@media (max-width: 768px) {
    .support-layout {
        grid-template-columns: 1fr;
    }
}

/* === Contact Page === */
.contact-page {
    display: flex;
    justify-content: center;
    padding: 40px 16px;
}

.contact-card {
    max-width: 560px;
    width: 100%;
    background: var(--background-section-color);
    border: 1px solid var(--border-color);
    border-radius: 14px;
    padding: 32px;
}

.contact-title {
    font-size: 1.5rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 6px;
}

.contact-subtitle {
    color: var(--secondary-text-color);
    font-size: 14px;
    margin-bottom: 24px;
}

.contact-form-group {
    margin-bottom: 14px;
}

.contact-form-group label {
    display: block;
    font-weight: 600;
    font-size: 13px;
    margin-bottom: 4px;
    color: var(--secondary-text-color);
}

.contact-optional {
    font-weight: 400;
    font-size: 12px;
    color: var(--secondary-text-color);
}

.contact-form-group input[type="text"],
.contact-form-group input[type="email"],
.contact-form-group textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background: var(--background-main-color);
    color: var(--primary-text-color);
    font-family: inherit;
    font-size: 14px;
    transition: border-color 0.2s;
}

.contact-form-group input:focus,
.contact-form-group textarea:focus {
    outline: none;
    border-color: var(--link-color);
}

.contact-form-group textarea {
    resize: vertical;
    min-height: 100px;
}

.contact-captcha-row {
    display: flex;
    align-items: center;
    gap: 8px;
}

.contact-captcha-img {
    height: 50px;
    border-radius: 6px;
    cursor: pointer;
    border: 1px solid var(--border-color);
    background: #fff;
}

.contact-captcha-reload {
    padding: 8px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    background: transparent;
    cursor: pointer;
    color: var(--secondary-text-color);
    transition: all 0.2s;
}

.contact-captcha-reload:hover {
    border-color: var(--link-color);
    color: var(--link-color);
}

.contact-captcha-input {
    width: 140px !important;
    font-family: 'Consolas', 'Monaco', monospace;
    letter-spacing: 2px;
}

.contact-submit-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 24px;
    margin-top: 4px;
    background: var(--link-color);
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: opacity 0.2s;
}

.contact-submit-btn:hover {
    opacity: 0.9;
}

.contact-success {
    padding: 16px;
    background: rgba(34, 197, 94, 0.1);
    border: 1px solid rgba(34, 197, 94, 0.3);
    border-radius: 8px;
    color: #22c55e;
    font-size: 15px;
    line-height: 1.6;
    text-align: center;
}

/* =================================================================
   LANGUAGE PICKER
   ================================================================= */
.lang-picker {
    position: relative;
    margin-left: 8px;
}

.lang-picker-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 10px;
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: var(--radius-sm);
    color: rgba(255, 255, 255, 0.9);
    cursor: pointer;
    font-size: 0.85rem;
    font-family: inherit;
    transition: all var(--transition-fast);
    white-space: nowrap;
}

.lang-picker-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.35);
}

.lang-dropdown {
    display: none;
    position: absolute;
    top: calc(100% + 6px);
    right: 0;
    min-width: 180px;
    background: #fff;
    border: 1px solid var(--card-border-color);
    border-radius: var(--radius-md);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
    z-index: 9999;
    overflow: hidden;
}

.lang-dropdown.open {
    display: block;
    animation: langDropIn 0.15s ease-out;
}

@keyframes langDropIn {
    from {
        opacity: 0;
        transform: translateY(-4px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.lang-option {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 14px;
    color: var(--dark-text-color);
    text-decoration: none;
    font-size: 0.9rem;
    transition: background var(--transition-fast);
}

.lang-option:hover {
    background: rgba(0, 123, 255, 0.06);
    color: var(--primary-color);
}

.lang-option.active {
    background: rgba(0, 123, 255, 0.08);
    color: var(--primary-color);
    font-weight: 600;
}

@media (max-width: 768px) {
    .lang-picker {
        margin-left: 4px;
    }

    .lang-picker-btn span {
        display: none;
    }

    .lang-picker-btn {
        padding: 5px 8px;
    }

    .lang-dropdown {
        right: -8px;
    }
}

/* =================================================================
   RTL (Right-to-Left) SUPPORT — Arabic, Hebrew, Persian, Urdu
   Activated when body has class "rtl" (set by translatePage JS)
   ================================================================= */
body.rtl {
    direction: rtl;
    text-align: right;
}

/* Header & Nav */
body.rtl header .container {
    flex-direction: row-reverse;
}

body.rtl #headerNav {
    flex-direction: row-reverse;
}

body.rtl #headerNav a {
    flex-direction: row-reverse;
}

body.rtl .lang-picker {
    margin-left: 0;
    margin-right: auto;
}

body.rtl .lang-dropdown {
    left: 0;
    right: auto;
}

/* Hero Section */
body.rtl .hero-section {
    text-align: right;
}

/* Feature Cards & Grid */
body.rtl .feature-card,
body.rtl .monetize-card {
    text-align: right;
}

/* News */
body.rtl .news-sidebar {
    order: 2;
}

body.rtl .news-content {
    order: 1;
}

body.rtl .news-card {
    text-align: right;
}

body.rtl .news-card .news-meta {
    flex-direction: row-reverse;
    justify-content: flex-end;
}

body.rtl .news-card .read-more {
    flex-direction: row-reverse;
}

/* Pagination */
body.rtl .pagination {
    flex-direction: row-reverse;
}

/* Contact Form */
body.rtl .contact-form label {
    text-align: right;
}

body.rtl .contact-form input,
body.rtl .contact-form textarea,
body.rtl .contact-form select {
    text-align: right;
}

/* Footer */
body.rtl footer .container {
    flex-direction: row-reverse;
}

body.rtl footer nav {
    flex-direction: row-reverse;
}

/* Archive Sidebar */
body.rtl .archive-item {
    flex-direction: row-reverse;
}

body.rtl .archive-months a {
    flex-direction: row-reverse;
    padding-left: 0;
    padding-right: 16px;
}

/* Icons next to text — flip margin */
body.rtl [data-lucide] {
    margin-right: 0;
    margin-left: 6px;
}

/* File format grid */
body.rtl .format-grid {
    direction: rtl;
}

/* CTA section */
body.rtl .cta-section {
    text-align: right;
}

/* Buttons with icon+text */
body.rtl .cta-button {
    flex-direction: row-reverse;
}

/* Modals */
body.rtl .modal-header {
    flex-direction: row-reverse;
}

body.rtl .modal-body {
    text-align: right;
}

/* General utility — flip flex gap items */
body.rtl .pagination-controls {
    flex-direction: row-reverse;
}

/* User Dropdown RTL */
body.rtl .user-dropdown-btn {
    flex-direction: row-reverse;
}

body.rtl .user-dropdown-menu {
    right: auto;
    left: 0;
}

body.rtl .user-dropdown-menu a {
    flex-direction: row-reverse;
}