/* ==== Base layout / dark premium theme ==== */

*,
*::before,
*::after {
    box-sizing: border-box;
}

html, body {
    margin: 0;
    padding: 0;
    height: 100%;
}

body {
    min-height: 100vh;
    font-family: system-ui, -apple-system, BlinkMacSystemFont,
                 "SF Pro Text", "Segoe UI", Roboto, sans-serif;
    background: radial-gradient(circle at top, #1f2937 0, #020617 45%, #000000 100%);
    color: #e5e7eb;
}

/* App shell: sidebar + main content */

.app-shell {
    display: flex;
    min-height: 100vh;
    background: radial-gradient(circle at top, #1f2937 0, #020617 45%, #000000 100%);
}

/* When sidebar is collapsed, main gets more room */
.app-shell.sidebar-collapsed .main-shell {
    /* no need for special margin; flex handles width */
}

.main-shell {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
}

/* ==== Sidebar ==== */

.sidebar {
    position: relative;
    width: 240px;
    background: linear-gradient(180deg, #020617, #020617 40%, #020617);
    border-right: 1px solid rgba(31, 41, 55, 0.9);
    box-shadow: 6px 0 24px rgba(0, 0, 0, 0.7);
    display: flex;
    flex-direction: column;
    transition: width 0.25s ease;
    z-index: 30;
}

.sidebar.collapsed {
    width: 72px;
}

.sidebar-inner {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 16px 14px 12px 14px;
}

/* Sidebar top: brand + nav */

.sidebar-top {
    flex: 1;
}

.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 24px;
}

.sidebar-logo {
    width: 32px;
    height: 32px;
    border-radius: 12px;
    background: conic-gradient(from 140deg, #38bdf8, #6366f1, #a855f7, #22c55e, #38bdf8);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #0b1120;
    font-weight: 700;
    font-size: 18px;
    box-shadow:
        0 0 0 1px rgba(15, 23, 42, 0.8),
        0 10px 24px rgba(15, 23, 42, 0.9);
}

.sidebar-brand-text {
    display: flex;
    flex-direction: column;
}

.sidebar-title {
    font-size: 16px;
    font-weight: 600;
    color: #f9fafb;
}

.sidebar-subtitle {
    font-size: 11px;
    color: #6b7280;
}

/* Hide brand text in collapsed mode */
.sidebar.collapsed .sidebar-brand-text {
    opacity: 0;
    pointer-events: none;
}

/* Nav */

.sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    border-radius: 10px;
    color: #9ca3af;
    text-decoration: none;
    font-size: 13px;
    transition:
        background 0.18s ease,
        color 0.18s ease,
        transform 0.12s ease;
}

.nav-item .nav-icon {
    font-size: 16px;
    width: 20px;
    text-align: center;
}

/* Hide labels in collapsed mode */
.sidebar.collapsed .nav-label {
    opacity: 0;
    width: 0;
    overflow: hidden;
    pointer-events: none;
}

/* Center icons when collapsed */
.sidebar.collapsed .nav-item {
    justify-content: center;
}

.nav-item:hover {
    background: rgba(15, 23, 42, 0.9);
    color: #e5e7eb;
    transform: translateY(-1px);
}

.nav-item.active {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.3), rgba(129, 140, 248, 0.35));
    color: #e5e7eb;
}

/* Sidebar bottom: user */

.sidebar-bottom {
    margin-top: 18px;
}

.sidebar-user {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    border-radius: 10px;
    background: rgba(15, 23, 42, 0.9);
    border: 1px solid rgba(31, 41, 55, 0.9);
}

.user-avatar {
    width: 26px;
    height: 26px;
    border-radius: 999px;
    background: radial-gradient(circle at top left, #4b5563, #111827);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    color: #e5e7eb;
}

.user-meta {
    display: flex;
    flex-direction: column;
}

.user-name {
    font-size: 12px;
    color: #f9fafb;
}

.user-status {
    font-size: 11px;
    color: #6b7280;
}

/* Hide user text in collapsed mode */
.sidebar.collapsed .user-meta {
    opacity: 0;
    pointer-events: none;
}

/* Sidebar toggle (floating chevron) */

/*.sidebar-toggle {
    position: absolute;
    top: 50%;
    right: -12px;
    transform: translateY(-50%);
    width: 24px;
    height: 46px;
    border-radius: 999px;
    border: 1px solid rgba(31, 41, 55, 0.9);
    background: radial-gradient(circle at top, #020617, #020617);
    color: #9ca3af;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 0 18px rgba(0, 0, 0, 0.9);
    padding: 0;
}
*/
.sidebar-toggle {
    position: absolute;
    top: 50%;
    right: 0; /* keep inside the sidebar */
    transform: translate(50%, -50%); /* visually move it outside */
    width: 24px;
    height: 46px;
    border-radius: 999px;
    border: 1px solid rgba(31, 41, 55, 0.9);
    background: radial-gradient(circle at top, #020617, #020617);
    color: #9ca3af;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 0 18px rgba(0, 0, 0, 0.9);
    padding: 0;
}

.sidebar-toggle .toggle-icon {
    font-size: 16px;
}

/* Flip chevron when collapsed */
.sidebar.collapsed .toggle-icon {
    transform: scaleX(-1);
}

/* ==== Header / brand / layout ==== */

.site-header {
    border-bottom: 1px solid rgba(148, 163, 184, 0.25);
    background: linear-gradient(135deg, rgba(15, 23, 42, 0.95), rgba(8, 47, 73, 0.9));
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
}

.header-inner {
    max-width: 1300px;
    margin: 0 auto;
    padding: 0 24px;
}

/* Single-row header layout */
.header-flex {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 140px;
    gap: 20px;
}

/* Brand in header */

.brand {
    display: flex;
    align-items: center;
    gap: 12px;
}

.brand-logo {
    width: 42px;
    height: 42px;
    border-radius: 14px;
    background: conic-gradient(from 140deg, #38bdf8, #6366f1, #a855f7, #22c55e, #38bdf8);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #0b1120;
    font-weight: 700;
    font-size: 20px;
    box-shadow:
        0 0 0 1px rgba(15, 23, 42, 0.7),
        0 12px 30px rgba(15, 23, 42, 0.8);
}

.brand-text {
    display: flex;
    flex-direction: column;
}

.brand-title {
    font-size: 20px;
    font-weight: 600;
    letter-spacing: 0.03em;
    color: #f9fafb;
}

.brand-subtitle {
    font-size: 12px;
    color: #9ca3af;
}

/* URL bar in header */

.url-bar {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
}

.url-input {
    width: 50%;
    min-width: 260px;
    max-width: 480px;
    padding: 10px 14px;
    font-size: 15px;
    border-radius: 999px;
    border: 1px solid rgba(148, 163, 184, 0.55);
    background: radial-gradient(circle at top left, #020617, #020617);
    color: #e5e7eb;
}

.url-input::placeholder {
    color: #6b7280;
}

/* Proxy selector + Go button */

.proxy-select {
    padding: 10px 17px;
    height: 42px;
    border-radius: 999px;
    border: 1px solid rgba(148, 163, 184, 0.55);
    background: radial-gradient(circle at top left, #020617, #020617);
    color: #e5e7eb;
    font-size: 13px;
    cursor: pointer;
}

.go-button {
    height: 42px;
    padding: 10px 20px;
    border: none;
    border-radius: 999px;
    background: linear-gradient(135deg, #3b82f6, #6366f1);
    color: #f9fafb;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
}

/* ==== Main content / iframe ==== */

.proxy-content {
    flex: 1;
    background: radial-gradient(circle at top, #020617 0, #020617 45%, #000000 100%);
    display: flex;
    flex-direction: column;
}

.proxy-frame {
    width: 100%;
    flex: 1;
    border: none;
    background: #0b1120;
}

/* ==== Empty State ==== */

.empty-state {
    max-width: 700px;
    margin: 0 auto;
    padding: 60px 20px;
    text-align: center;
    color: #e5e7eb;
}

.empty-icon {
    font-size: 48px;
    margin-bottom: 14px;
}

.empty-title {
    font-size: 28px;
    font-weight: 600;
    margin-bottom: 8px;
    color: #f3f4f6;
}

.empty-subtitle {
    font-size: 15px;
    color: #9ca3af;
    margin-bottom: 32px;
}

.empty-features {
    display: flex;
    justify-content: center;
    gap: 26px;
    flex-wrap: wrap;
}

.feature {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding: 14px 18px;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(148, 163, 184, 0.2);
    min-width: 120px;
}

.feature-icon {
    font-size: 22px;
}

.feature-text {
    font-size: 13px;
    color: #d1d5db;
}

/* ==== Footer ==== */

.site-footer {
    background: radial-gradient(circle at top left, #020617, #020617);
    color: #6b7280;
    text-align: center;
    padding: 10px 12px;
    font-size: 12px;
    border-top: 1px solid rgba(31, 41, 55, 0.9);
}

/* ==== Responsive ==== */

@media (max-width: 900px) {
    .header-flex {
        flex-direction: column;
        height: auto;
        padding: 20px 0;
        gap: 16px;
    }

    .url-input {
        width: 100%;
    }

    .sidebar {
        width: 72px;
    }

    .sidebar:not(.collapsed) {
        width: 180px;
    }
}
/* ==== Page Layouts ==== */

.page-wrapper {
    padding: 40px 50px;
    color: #e5e7eb;
}

.page-title {
    font-size: 26px;
    font-weight: 600;
    margin-bottom: 6px;
    color: #f3f4f6;
}

.page-subtitle {
    font-size: 14px;
    color: #9ca3af;
    margin-bottom: 30px;
}

.page-placeholder {
    margin-top: 40px;
    padding: 40px;
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(148, 163, 184, 0.2);
    text-align: center;
    max-width: 500px;
}

.placeholder-icon {
    font-size: 40px;
    margin-bottom: 12px;
}

.placeholder-text {
    font-size: 15px;
    color: #d1d5db;
}
/* ==== Auth pages ==== */

.auth-body {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background: radial-gradient(circle at top, #1f2937 0, #020617 45%, #000000 100%);
    color: #e5e7eb;
    margin: 0;
}

.auth-container {
    width: 100%;
    max-width: 380px;
    padding: 32px 26px;
    border-radius: 18px;
    background: rgba(15, 23, 42, 0.95);
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.8);
    border: 1px solid rgba(148, 163, 184, 0.3);
}

.auth-title {
    font-size: 24px;
    font-weight: 600;
    margin-bottom: 6px;
    color: #f9fafb;
}

.auth-subtitle {
    font-size: 13px;
    color: #9ca3af;
    margin-bottom: 18px;
}

.auth-errors {
    margin-bottom: 16px;
}

.auth-error {
    background: rgba(127, 29, 29, 0.9);
    border-radius: 8px;
    padding: 8px 10px;
    font-size: 13px;
    color: #fee2e2;
}

.auth-form {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.auth-label {
    font-size: 13px;
    color: #d1d5db;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.auth-input {
    border-radius: 999px;
    border: 1px solid rgba(148, 163, 184, 0.6);
    padding: 9px 12px;
    background: #020617;
    color: #e5e7eb;
    font-size: 14px;
    outline: none;
}

.auth-input:focus {
    border-color: rgba(59, 130, 246, 0.9);
    box-shadow: 0 0 0 1px rgba(59, 130, 246, 0.7);
}

.auth-button {
    margin-top: 4px;
    border-radius: 999px;
    border: none;
    padding: 10px 14px;
    background: linear-gradient(135deg, #3b82f6, #6366f1);
    color: #f9fafb;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
}

.auth-footer-text {
    margin-top: 14px;
    font-size: 13px;
    color: #9ca3af;
    text-align: center;
}

.auth-link {
    color: #60a5fa;
    text-decoration: none;
}
.sidebar-user {
    color: #ccc;
    font-size: 0.9rem;
}

.sidebar-user .user-label {
    font-size: 0.75rem;
    opacity: 0.7;
    margin-bottom: 2px;
}

.sidebar-user .user-id {
    display: flex;
    align-items: center;
    gap: 6px;
    font-weight: 600;
    color: #fff;
}

.copy-id-btn {
    background: none;
    border: none;
    color: #888;
    cursor: pointer;
    font-size: 0.9rem;
    padding: 0;
}

.copy-id-btn:hover {
    color: #fff;
}
/* ==== Account Chip (Bottom Left) ==== */

.sidebar-user-chip {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 8px 10px;
    border-radius: 10px;
    background: rgba(15, 23, 42, 0.9);
    border: 1px solid rgba(31, 41, 55, 0.9);
}

.chip-label {
    font-size: 11px;
    color: #9ca3af;
    opacity: 0.8;
}

.chip-box {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 6px 10px;        /* makes the chip 5px bigger visually */
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(148, 163, 184, 0.25);
    border-radius: 8px;
}

.chip-id {
    font-size: 13px;
    font-weight: 600;
    color: #f9fafb;
}

.chip-copy {
    background: none;
    border: none;
    color: #9ca3af;
    cursor: pointer;
    font-size: 14px;
    padding: 2px 4px;         /* increases click area */
    border-radius: 4px;
}

.chip-copy:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.08);
}
.sidebar-user-chip {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.account-actions {
    margin-top: 0.35rem;
}

.logout-link {
    font-size: 0.85rem;
    color: #4ea1ff;
    text-decoration: none;
}

.logout-link:hover {
    text-decoration: underline;
}
.sidebar-login-icon {
    margin: 0.5rem 0 1rem 0;
}

.login-icon-link {
    color: #4ea1ff;
    font-size: 0.9rem;
    text-decoration: none;
}

.login-icon-link:hover {
    text-decoration: underline;
}

.login-link, .logout-link {
    color: #4ea1ff;
    font-size: 0.85rem;
    text-decoration: none;
}

.login-link:hover, .logout-link:hover {
    text-decoration: underline;
}
/* ============================
   GUEST TOP URL BAR
============================ */
.guest-url-bar {
    padding: 1rem 1.5rem;
    background: #111;
    border-bottom: 1px solid #222;
}

.guest-url-form {
    display: flex;
    gap: 0.5rem;
}

.guest-url-input {
    flex: 1;
    padding: 0.65rem 0.9rem;
    background: #1a1a1a;
    border: 1px solid #333;
    border-radius: 6px;
    color: #fff;
    font-size: 0.95rem;
}

.guest-url-input:focus {
    outline: none;
    border-color: #4ea1ff;
}

.guest-url-button {
    padding: 0.65rem 1.2rem;
    background: #4ea1ff;
    border: none;
    border-radius: 6px;
    color: #000;
    font-weight: 600;
    cursor: pointer;
}

.guest-url-button:hover {
    background: #6bb6ff;
}


/* ============================
   LOGGED-IN TAB BAR
============================ */
.browser-tabs {
    display: flex;
    gap: 0.25rem;
    padding: 0.5rem 1rem 0.25rem 1rem;
    background: #111;
    border-bottom: 1px solid #222;
}

.tab {
    padding: 0.4rem 0.9rem;
    background: #1a1a1a;
    border: 1px solid #333;
    border-bottom: none;
    border-radius: 6px 6px 0 0;
    color: #ccc;
    cursor: pointer;
    font-size: 0.9rem;
}

.tab.active {
    background: #222;
    color: #fff;
    border-color: #4ea1ff;
}

.tab:hover {
    background: #262626;
}

.tab.new-tab {
    font-weight: bold;
    padding: 0.4rem 0.8rem;
}


/* ============================
   LOGGED-IN URL BAR
============================ */
.browser-url-bar {
    padding: 0.5rem 1rem;
    background: #111;
    border-bottom: 1px solid #222;
}

.browser-url-form {
    display: flex;
    gap: 0.5rem;
}

.browser-url-input {
    flex: 1;
    padding: 0.6rem 0.9rem;
    background: #1a1a1a;
    border: 1px solid #333;
    border-radius: 6px;
    color: #fff;
    font-size: 0.95rem;
}

.browser-url-input:focus {
    outline: none;
    border-color: #4ea1ff;
}

.browser-url-button {
    padding: 0.6rem 1.2rem;
    background: #4ea1ff;
    border: none;
    border-radius: 6px;
    color: #000;
    font-weight: 600;
    cursor: pointer;
}

.browser-url-button:hover {
    background: #6bb6ff;
}
.header-url-bar {
    padding: 0.75rem 1.5rem;
    background: #111;
    border-bottom: 1px solid #222;
}

.header-region {
    display: flex;
    align-items: center;
}

.proxy-select {
    background: #1a1a1a;
    border: 1px solid #333;
    color: #fff;
    padding: 0.4rem 0.6rem;
    border-radius: 6px;
}
.hidden {
    display: none !important;
}

/* Tabs already styled earlier; add close button + label tweaks */
.tab {
    position: relative;
    display: flex;
    align-items: center;
    gap: 0.35rem;
}

.tab-label {
    max-width: 120px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.tab-close {
    font-size: 0.8rem;
    cursor: pointer;
    opacity: 0.6;
}

.tab-close:hover {
    opacity: 1;
}
.hidden {
    display: none !important;
}

/* URL bar nav controls */
.browser-url-form {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.browser-nav-buttons {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.nav-button {
    background: #1a1a1a;
    border: 1px solid #333;
    color: #ccc;
    width: 28px;
    height: 28px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.8rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.nav-button:hover:not(:disabled) {
    background: #262626;
    color: #fff;
}

.nav-button:disabled {
    opacity: 0.4;
    cursor: default;
}
.nav-button[disabled]::after {
    content: "URL bar history only";
    position: absolute;
    bottom: -1.6rem;
    left: 50%;
    transform: translateX(-50%);
    background: #222;
    color: #aaa;
    font-size: 0.7rem;
    padding: 0.2rem 0.4rem;
    border-radius: 4px;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
}

.nav-button[disabled]:hover::after {
    opacity: 1;
}
/* Wrapper for nav buttons */
.nav-button-wrapper {
    position: relative;
}

/* Tooltip when disabled */
.nav-button-wrapper.disabled-tooltip:hover::after {
    content: "URL bar history only";
    position: absolute;
    bottom: -1.6rem;
    left: 50%;
    transform: translateX(-50%);
    background: #222;
    color: #aaa;
    font-size: 0.7rem;
    padding: 0.2rem 0.4rem;
    border-radius: 4px;
    white-space: nowrap;
    opacity: 1;
    pointer-events: none;
    z-index: 50;
}

/* Nav button styling */
.nav-button {
    background: #1a1a1a;
    border: 1px solid #333;
    color: #ccc;
    width: 28px;
    height: 28px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.8rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.nav-button:hover:not(:disabled) {
    background: #262626;
    color: #fff;
}

.nav-button:disabled {
    opacity: 0.4;
    cursor: default;
}
/* Header container */
.app-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 1rem;
    background: #111;
    border-bottom: 1px solid #222;
}

/* Left side */
.header-left {
    display: flex;
    align-items: center;
}

/* Welcome text for logged-in users */
.header-welcome {
    font-size: 0.95rem;
    color: #bbb;
    user-select: none;
}

/* Logo for guests */
.header-logo-img {
    height: 32px;
    width: auto;
}

/* Right side */
.header-right {
    display: flex;
    align-items: center;
}

/* Region selector */
.region-selector {
    margin-left: 1rem;
}

.region-dropdown {
    background: #1a1a1a;
    color: #ddd;
    border: 1px solid #333;
    padding: 0.35rem 0.6rem;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.85rem;
}

.region-dropdown:hover {
    background: #222;
}
.guest-warning {
    background: #2a1f00;
    color: #ffcc66;
    padding: 0.5rem 0.75rem;
    border-radius: 6px;
    font-size: 0.85rem;
    font-weight: 500;
    border: 1px solid #3a2a00;
    user-select: none;
}

.guest-warning .guest-link {
    color: #ffd27f;
    text-decoration: underline;
    font-weight: 600;
}

.guest-warning .guest-link:hover {
    color: #ffe6b3;
}

.guest-warning {
    background: #2a1f00;
    color: #ffcc66;
    padding: 0.5rem 0.75rem;
    border-radius: 6px;
    font-size: 0.85rem;
    font-weight: 500;
    border: 1px solid #3a2a00;
    user-select: none;
    display: flex;
    align-items: center;
    gap: 0.4rem;
    position: relative;
}

.guest-icon {
    font-size: 1rem;
}

.guest-link {
    color: #ffd27f;
    text-decoration: underline;
    font-weight: 600;
}

.guest-link:hover {
    color: #ffe6b3;
}

.guest-dismiss {
    background: transparent;
    border: none;
    color: #ffcc66;
    font-size: 1rem;
    cursor: pointer;
    padding: 0 0.25rem;
    position: absolute;
    right: 6px;
    top: 4px;
}

.guest-dismiss:hover {
    color: #fff1c2;
}
.bookmarks-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1rem;
    margin-top: 1rem;
}

.bookmark-card {
    background: #141414;
    border: 1px solid #222;
    border-radius: 8px;
    overflow: hidden;
    width: 250px;
    height: 250px;
    display: flex;
    flex-direction: column;
    position: relative;
}

.bookmark-thumb {
    flex: 1 0 55%;
    background: #111;
    display: flex;
    align-items: center;
    justify-content: center;
}

.bookmark-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.bookmark-thumb-placeholder {
    color: #555;
    font-size: 0.8rem;
    padding: 0.5rem;
    text-align: center;
}

.bookmark-body {
    flex: 0 0 45%;
    padding: 0.5rem 0.75rem;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.bookmark-title {
    font-size: 0.9rem;
    font-weight: 600;
    color: #eee;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.bookmark-url {
    font-size: 0.8rem;
    color: #999;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.bookmark-meta {
    font-size: 0.75rem;
    color: #666;
    margin-top: auto;
}

.bookmark-delete-form {
    position: absolute;
    top: 4px;
    right: 4px;
}

.bookmark-delete-btn {
    background: rgba(0, 0, 0, 0.6);
    border: 1px solid #444;
    color: #ccc;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.8rem;
    padding: 0.1rem 0.3rem;
}

.bookmark-delete-btn:hover {
    background: #661111;
    color: #fff;
}

/* Bookmark button next to URL bar */
.bookmark-btn {
    background: #222;
    border: 1px solid #333;
    color: #ffdd66;
    padding: 0.35rem 0.6rem;
    border-radius: 6px;
    cursor: pointer;
    font-size: 1rem;
    margin-left: 0.4rem;
}

.bookmark-btn:hover {
    background: #333;
}
.bookmarks-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 18px;
}

.bookmark-card {
    background: var(--surface);
    border-radius: 10px;
    padding: 14px;
    display: flex;
    flex-direction: column;
    position: relative;
}

.bookmark-thumb img {
    width: 100%;
    height: 140px;
    object-fit: cover;
    border-radius: 8px;
}

.bookmark-thumb-placeholder {
    width: 100%;
    height: 140px;
    background: var(--surface-2);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
}

.bookmark-title {
    font-weight: 600;
    margin-top: 10px;
}

.bookmark-url {
    font-size: 0.9rem;
    color: var(--text-muted);
    margin-top: 4px;
}

.bookmark-meta {
    font-size: 0.8rem;
    margin-top: 8px;
    color: var(--text-muted);
}

.bookmark-delete-form {
    position: absolute;
    top: 10px;
    right: 10px;
}

.bookmark-delete-btn {
    background: transparent;
    border: none;
    cursor: pointer;
    font-size: 1.1rem;
}
/* Bookmark Placeholder – Browser Window Mock */
.browser-window-mock {
    background: #f4f4f6;
    border: 1px solid #dcdce0;
    border-radius: 8px;
    height: 100%;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    color: #555;
    font-size: 14px;
}

.browser-window-mock .bw-topbar {
    background: #e6e6ea;
    height: 22px;
    display: flex;
    align-items: center;
    padding: 0 8px;
    gap: 6px;
}

.browser-window-mock .bw-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    display: inline-block;
}

.browser-window-mock .bw-dot.red { background: #ff5f57; }
.browser-window-mock .bw-dot.yellow { background: #ffbd2e; }
.browser-window-mock .bw-dot.green { background: #28c840; }

.browser-window-mock .bw-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 12px;
    text-align: center;
}

.browser-window-mock .bw-icon {
    font-size: 28px;
    opacity: 0.6;
    margin-bottom: 6px;
}

.browser-window-mock .bw-text {
    font-size: 13px;
    color: #777;
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
    .browser-window-mock {
        background: #2a2a2d;
        border-color: #3a3a3d;
        color: #ccc;
    }
    .browser-window-mock .bw-topbar {
        background: #3a3a3d;
    }
    .browser-window-mock .bw-text {
        color: #aaa;
    }
}
.toast {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: #2ecc71;
    color: white;
    padding: 12px 18px;
    border-radius: 6px;
    font-size: 14px;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.3s ease, transform 0.3s ease;
    z-index: 9999;
}
.toast.show {
    opacity: 1;
    transform: translateY(0);
}

/* ============================================
   DASHBOARD LAYOUT
============================================ */
.dashboard-content {
    padding: 40px;
    max-width: 1200px;
    margin: 0 auto;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* ============================================
   HERO SECTION
============================================ */
.dashboard-hero {
    text-align: center;
    margin-bottom: 50px;
}

.dashboard-title {
    font-size: 2.4rem;
    font-weight: 700;
    margin-bottom: 10px;
}

.dashboard-subtitle {
    font-size: 1.2rem;
    opacity: 0.8;
    margin-bottom: 25px;
}

.dashboard-actions {
    display: flex;
    justify-content: center;
    gap: 20px;
}

.dashboard-btn {
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    text-decoration: none;
    transition: 0.2s ease;
}

.dashboard-btn.primary {
    background: #4a8dfc;
    color: white;
}

.dashboard-btn.primary:hover {
    background: #3a7be0;
}

.dashboard-btn.secondary {
    background: #333;
    color: white;
}

.dashboard-btn.secondary:hover {
    background: #444;
}

/* ============================================
   ALERTS / ANNOUNCEMENTS
============================================ */
.dashboard-alerts {
    margin-bottom: 40px;
}

.alert-box {
    padding: 15px 20px;
    border-radius: 8px;
    margin-bottom: 15px;
    font-size: 0.95rem;
}

.alert-box.info {
    background: #1e3a5f;
    border-left: 4px solid #4a8dfc;
    color: #cfe2ff;
}

/* ============================================
   FEATURE GRID
============================================ */
.dashboard-features {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
    gap: 25px;
    margin-bottom: 50px;
}

.feature-card {
    background: #1b1b1b;
    padding: 25px;
    border-radius: 10px;
    text-align: center;
    transition: 0.2s ease;
    border: 1px solid #2a2a2a;
}

.feature-card:hover {
    transform: translateY(-4px);
    border-color: #4a8dfc;
}

.feature-icon {
    font-size: 2rem;
    margin-bottom: 10px;
}

.feature-title {
    font-size: 1.2rem;
    font-weight: 600;
    margin-bottom: 8px;
}

.feature-desc {
    font-size: 0.9rem;
    opacity: 0.8;
    margin-bottom: 15px;
}

.feature-link {
    display: inline-block;
    padding: 8px 16px;
    background: #4a8dfc;
    color: white;
    border-radius: 6px;
    text-decoration: none;
    font-size: 0.9rem;
    transition: 0.2s ease;
}

.feature-link:hover {
    background: #3a7be0;
}

/* ============================================
   PROMO / AD BLOCK
============================================ */
.dashboard-promo {
    margin-bottom: 60px;
}

.promo-box {
    background: #222;
    padding: 30px;
    border-radius: 10px;
    text-align: center;
    border: 1px solid #333;
}

.promo-box h2 {
    font-size: 1.6rem;
    margin-bottom: 10px;
}

.promo-box p {
    font-size: 1rem;
    opacity: 0.85;
}

.storage-header {
    margin-bottom: 30px;
}

.storage-title {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 8px;
}

.storage-subtitle {
    font-size: 1rem;
    opacity: 0.8;
}

.storage-upload {
    margin-bottom: 30px;
}

.storage-upload-form {
    display: flex;
    gap: 15px;
    align-items: center;
    margin-top: 10px;
}

.storage-upload-note {
    font-size: 0.85rem;
    opacity: 0.7;
    margin-top: 6px;
}

.storage-files h2 {
    margin-bottom: 15px;
}

.storage-empty {
    opacity: 0.8;
    font-size: 0.95rem;
}

.storage-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.95rem;
    background: #1b1b1b;
    border-radius: 8px;
    overflow: hidden;
}

.storage-table th,
.storage-table td {
    padding: 10px 12px;
    border-bottom: 1px solid #2a2a2a;
}

.storage-table th {
    background: #222;
    text-align: left;
    font-weight: 600;
}

.storage-table tr:last-child td {
    border-bottom: none;
}

.storage-actions {
    display: flex;
    gap: 10px;
    align-items: center;
}

.storage-action-link {
    background: none;
    border: none;
    color: #4a8dfc;
    text-decoration: none;
    cursor: pointer;
    padding: 0;
    font-size: 0.9rem;
}

.storage-action-link:hover {
    text-decoration: underline;
}

.storage-action-link.danger {
    color: #ff6b6b;
}

.storage-delete-form {
    display: inline;
}
/* ============================================
   FILE GRID (OneDrive style)
============================================ */
.file-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.file-tile {
    background: #1b1b1b;
    border: 1px solid #2a2a2a;
    border-radius: 10px;
    padding: 12px;
    position: relative;
    transition: 0.2s ease;
    cursor: pointer;
}

.file-tile:hover {
    transform: translateY(-4px);
    border-color: #4a8dfc;
}

.file-thumb {
    width: 100%;
    height: 120px;
    background: #111;
    border-radius: 6px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

.file-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.file-name {
    margin-top: 10px;
    font-size: 0.9rem;
    text-align: center;
    word-break: break-word;
}

/* ============================================
   FILE MENU (three-dot menu)
============================================ */
.file-menu {
    position: absolute;
    top: 8px;
    right: 8px;
}

.file-menu-btn {
    background: none;
    border: none;
    font-size: 1.2rem;
    color: #ccc;
    cursor: pointer;
}

.file-menu-dropdown {
    display: none;
    position: absolute;
    top: 22px;
    right: 0;
    background: #222;
    border: 1px solid #333;
    border-radius: 6px;
    padding: 8px 0;
    min-width: 120px;
    z-index: 20;
}

.file-menu-dropdown a,
.file-menu-dropdown button {
    display: block;
    width: 100%;
    padding: 8px 12px;
    text-align: left;
    background: none;
    border: none;
    color: #ddd;
    font-size: 0.9rem;
    cursor: pointer;
}

.file-menu-dropdown a:hover,
.file-menu-dropdown button:hover {
    background: #333;
}

.file-menu-dropdown .danger {
    color: #ff6b6b;
}
/* ============================
   HEADER GRID
============================ */
.storage-header-grid {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 20px;
    margin-bottom: 30px;
    align-items: center;
}

.header-left h1 {
    font-size: 2rem;
    font-weight: 700;
}

.header-center p {
    font-size: 1rem;
    opacity: 0.8;
}

.header-right {
    display: flex;
    justify-content: flex-end;
}

.upload-box {
    background: #1b1b1b;
    padding: 15px;
    border-radius: 10px;
    border: 1px solid #2a2a2a;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

.upload-box input[type="file"] {
    margin-bottom: 10px;
}

.upload-note {
    font-size: 0.8rem;
    opacity: 0.6;
}

/* ============================
   FOLDER CONTAINER
============================ */
.storage-folder {
    background: #111;
    padding: 25px;
    border-radius: 12px;
    border: 1px solid #2a2a2a;
}

.folder-title {
    font-size: 1.2rem;
    font-weight: 600;
    margin-bottom: 15px;
}

/* ============================
   HEADER: 3-COLUMN GRID
============================ */
.storage-header-grid {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr; /* 1/3 | 1/3 | 1/3 */
    gap: 20px;
    margin-bottom: 25px;
    align-items: center;
}

.header-cell {
    min-width: 0;
}

.header-left .storage-title {
    font-size: 2rem;
    font-weight: 700;
}

.header-center .storage-subtitle {
    font-size: 1rem;
    opacity: 0.8;
}

.header-right {
    display: flex;
    justify-content: flex-end;
}

/* Upload box in top-right */
.upload-box {
    background: #1b1b1b;
    padding: 12px 15px;
    border-radius: 10px;
    border: 1px solid #2a2a2a;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

.upload-row {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 6px;
}

.upload-note {
    font-size: 0.8rem;
    opacity: 0.6;
}

/* ============================
   FOLDER CONTAINER BOTTOM
============================ */

.folder-title {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 15px;
}

/* Grid of files inside the folder container */
.file-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 20px;
}

/* File tiles (stay as before, but now visually "inside" folder) */
.file-tile {
    background: #1b1b1b;
    border: 1px solid #2a2a2a;
    border-radius: 10px;
    padding: 12px;
    position: relative;
    transition: 0.2s ease;
    cursor: pointer;
}

.file-thumb {
    width: 100%;
    height: 120px;
    background: #111;
    border-radius: 6px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

.file-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.file-name {
    margin-top: 8px;
    font-size: 0.9rem;
    text-align: center;
    word-break: break-word;
}

.file-meta {
    margin-top: 4px;
    font-size: 0.8rem;
    opacity: 0.7;
    text-align: center;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

/* Menu stays as before */
.file-menu {
    position: absolute;
    top: 8px;
    right: 8px;
}

.file-menu-btn {
    background: none;
    border: none;
    font-size: 1.2rem;
    color: #ccc;
    cursor: pointer;
}

.file-menu-dropdown {
    display: none;
    position: absolute;
    top: 22px;
    right: 0;
    background: #222;
    border: 1px solid #333;
    border-radius: 6px;
    padding: 8px 0;
    min-width: 130px;
    z-index: 20;
}

.file-menu-dropdown a,
.file-menu-dropdown button {
    display: block;
    width: 100%;
    padding: 8px 12px;
    text-align: left;
    background: none;
    border: none;
    color: #ddd;
    font-size: 0.9rem;
    cursor: pointer;
}

.file-menu-dropdown a:hover,
.file-menu-dropdown button:hover {
    background: #333;
}

.file-menu-dropdown .danger {
    color: #ff6b6b;
}
/* Ensure main fills available vertical space */
.main-shell {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* Folder container spans full width */
.storage-folder {
    flex-grow: 1;
    width: 100%;
    background: #111;
    padding: 25px;
    border-radius: 12px;
    border: 1px solid #2a2a2a;
    box-sizing: border-box;
}
/* Make the main-shell fill full width */
.main-shell {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    width: 100%;
}

/* Make header grid span full width */
.storage-header-grid {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 20px;
    width: 100%;
    align-items: center;
    margin-bottom: 25px;
}
/* Remove width constraints from storage-content */
.storage-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    width: 100%;
    padding: 40px 40px; /* remove horizontal padding */
    box-sizing: border-box;
}

/* Thumbnail stays fixed height */
.file-thumb {
    width: 100%;
    height: 120px;
    background: #111;
    border-radius: 6px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

.file-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Filename */
.file-name {
    margin-top: 8px;
    font-size: 0.9rem;
    text-align: center;
    word-break: break-word;
}

/* Metadata — tighten spacing */
.file-meta {
    margin-top: 4px;
    font-size: 0.8rem;
    opacity: 0.7;
    text-align: center;
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.file-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 20px;
    align-items: start; /* THIS is the key fix */
}

.file-tile {
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    height: auto; /* prevent stretch */
    background: #1b1b1b;
    border: 1px solid #2a2a2a;
    border-radius: 10px;
    padding: 12px;
    position: relative;
    transition: 0.2s ease;
    cursor: pointer;
}
/* ============================
   PREMIUM GLASSY UPLOAD ZONE
============================ */
.upload-drop {
    background: rgba(255, 255, 255, 0.05); /* subtle glass */
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);

    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 14px;

    padding: 16px 26px;
    cursor: pointer;
    text-align: center;

    color: #e0e0e0;
    font-size: 0.95rem;
    font-weight: 500;
    letter-spacing: 0.2px;

    transition: all 0.25s ease;
    box-shadow: 0 4px 14px rgba(0,0,0,0.25);
}

.upload-drop:hover {
    background: rgba(255, 255, 255, 0.10);
    border-color: rgba(255, 255, 255, 0.18);
    transform: translateY(-2px);
    box-shadow: 0 6px 18px rgba(0,0,0,0.35);
}

.upload-drop label {
    cursor: pointer;
}

.upload-drop input[type="file"] {
    display: none;
}
.storage-usage {
    margin: 20px 0 30px 0;
}

.usage-label {
    font-size: 0.9rem;
    opacity: 0.8;
    margin-bottom: 6px;
}

.usage-bar {
    width: 100%;
    height: 8px;
    background: #1a1a1a;
    border-radius: 6px;
    overflow: hidden;
    border: 1px solid #2a2a2a;
}

.usage-fill {
    height: 100%;
    background: linear-gradient(90deg, #4a8dfc, #6aa8ff);
    transition: width 0.3s ease;
}
.upgrade-banner {
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.12);
    padding: 12px 16px;
    border-radius: 10px;
    margin-bottom: 20px;
    text-align: center;
    color: #e0e0e0;
}
/* Upload drop zone */
.upload-drop {
    border: 2px dashed rgba(255,255,255,0.15);
    border-radius: 10px;
    padding: 30px;
    text-align: center;
    cursor: pointer;
    transition: border-color 0.2s ease, background 0.2s ease;
    position: relative;
}

/* Hidden input stays hidden */
.upload-drop input[type="file"] {
    display: none;
}

/* Label styling */
.upload-drop label {
    display: block;
    font-size: 15px;
    color: rgba(255,255,255,0.7);
    cursor: pointer;
    user-select: none;
}

/* Drag-over highlight */
.upload-drop.dragover {
    border-color: #4da3ff;
    background: rgba(77,163,255,0.08);
}

/* Optional: subtle hover effect */
.upload-drop:hover {
    border-color: rgba(255,255,255,0.25);
}
.header-center .upload-drop {
    width: 100%;
    height: 140px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.alert-box {
    transition: opacity 0.4s ease, transform 0.4s ease;
}
body.tor-mode footer {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
}
.nav-badge {
    background: #6a5acd;
    color: #fff;
    font-size: 12px;
    padding: 2px 7px;
    border-radius: 12px;
    margin-left: auto;
    margin-right: 10px;
}
/* ============================================
   Messaging layout integration with app shell
   ============================================ */

.messaging-page .main-shell {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* Ensure header stays at natural height */
.messaging-page .app-header {
    flex-shrink: 0;
}

/* Messaging content fills space between header and footer */
.messaging-page .messaging-content {
    flex: 1;
    min-height: 0;
    display: flex;
    overflow: hidden;
}

/* Scrolling area inside thread view */
.messaging-page .thread-right .messages-scroll {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
}
/* ============================================
   Messaging layout: wider thread list on desktop
   ============================================ */

.messaging-page .messaging-content {
    display: flex;
    flex-direction: row;
    min-height: 0;
    flex: 1;
    overflow: hidden;
}

.messaging-page .inbox-left {
    width: 560px; /* wider than default */
    min-width: 320px;
    max-width: 660px;
    border-right: 1px solid #222;
    background: #0f0f0f;
    display: flex;
    flex-direction: column;
    padding-left: 40px; /* main fix */ 
    padding-right: 20px; /* optional, keeps symmetry */
}

.messaging-page .inbox-right {
    flex: 1;
    padding: 40px;
    overflow-y: auto;
}
/* ============================================
   New Message Button – desktop + mobile
   ============================================ */

/* Base: desktop / default inline button in header */
.new-msg-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: #1a73e8;
    color: #fff;
    font-size: 24px;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    transition: background 0.2s ease, transform 0.15s ease;
    user-select: none;
    box-shadow: none;
    position: static;      /* IMPORTANT: no fixed positioning on desktop */
}

.new-msg-btn:hover {
    background: #1664c4;
    transform: translateY(-1px);
}

.new-msg-btn:active {
    transform: translateY(0);
}

/* Mobile: turn it into a floating action button */
@media (max-width: 768px) {
    .new-msg-btn {
        position: fixed;
        bottom: 80px;      /* adjust to sit nicely above footer */
        right: 20px;
        width: 56px;
        height: 56px;
        font-size: 30px;
        box-shadow: 0 4px 12px rgba(0,0,0,0.4);
        z-index: 9999;
    }
/* ============================================
   New Message Page Styling
   ============================================ */

.messaging-page .new-message-panel {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
    background: #0f0f0f;
}

.messaging-page .new-message-form {
    width: 100%;
    max-width: 480px;
    background: #111;
    padding: 30px;
    border-radius: 12px;
    box-shadow: 0 0 0 1px #222;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.messaging-page .new-message-header {
    margin-bottom: 30px;
    text-align: center;
}

.messaging-page .new-message-header h2 {
    font-size: 24px;
    font-weight: 600;
    margin: 0;
    color: #fff;
}

.messaging-page .form-label {
    display: flex;
    flex-direction: column;
    gap: 8px;
    color: #ccc;
    font-size: 14px;
}

.messaging-page .form-input,
.messaging-page .form-textarea {
    background: #1a1a1a;
    border: 1px solid #333;
    border-radius: 6px;
    padding: 10px 14px;
    font-size: 15px;
    color: #fff;
    resize: vertical;
}

.messaging-page .form-textarea {
    min-height: 100px;
}

.messaging-page .form-actions {
    display: flex;
    justify-content: space-between;
    gap: 12px;
}

.messaging-page .primary-button,
.messaging-page .secondary-button {
    padding: 10px 18px;
    border-radius: 6px;
    font-size: 15px;
    font-weight: 500;
    text-decoration: none;
    cursor: pointer;
    transition: background 0.2s ease;
}

.messaging-page .primary-button {
    background: #1a73e8;
    color: #fff;
    border: none;
}

.messaging-page .primary-button:hover {
    background: #1664c4;
}

.messaging-page .secondary-button {
    background: #222;
    color: #ccc;
    border: none;
}

.messaging-page .secondary-button:hover {
    background: #333;
    color: #fff;
}

.messaging-page .form-errors {
    background: #2a0000;
    color: #f88;
    padding: 12px;
    border-radius: 6px;
    margin-bottom: 20px;
    font-size: 14px;
}
/* ============================================
   New Message Page Styling (Corrected)
   ============================================ */

.new-message-panel {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
    background: #0f0f0f;
}

.new-message-header {
    margin-bottom: 30px;
    text-align: center;
}

.new-message-header h2 {
    font-size: 24px;
    font-weight: 600;
    margin: 0;
    color: #fff;
}

.new-message-form {
    width: 100%;
    max-width: 480px;
    background: #111;
    padding: 30px;
    border-radius: 12px;
    box-shadow: 0 0 0 1px #222;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.form-label {
    display: flex;
    flex-direction: column;
    gap: 8px;
    color: #ccc;
    font-size: 14px;
}

.form-input,
.form-textarea {
    background: #1a1a1a;
    border: 1px solid #333;
    border-radius: 6px;
    padding: 10px 14px;
    font-size: 15px;
    color: #fff;
    resize: vertical;
}

.form-textarea {
    min-height: 100px;
}

.form-actions {
    display: flex;
    justify-content: space-between;
    gap: 12px;
}

.primary-button,
.secondary-button {
    padding: 10px 18px;
    border-radius: 6px;
    font-size: 15px;
    font-weight: 500;
    text-decoration: none;
    cursor: pointer;
    transition: background 0.2s ease;
}

.primary-button {
    background: #1a73e8;
    color: #fff;
    border: none;
}

.primary-button:hover {
    background: #1664c4;
}

.secondary-button {
    background: #222;
    color: #ccc;
    border: none;
}

.secondary-button:hover {
    background: #333;
    color: #fff;
}

.form-errors {
    background: #2a0000;
    color: #f88;
    padding: 12px;
    border-radius: 6px;
    margin-bottom: 20px;
    font-size: 14px;
}
/* ============================================
   Override messaging layout for New Message page
   ============================================ */

.messaging-page .new-message-panel {
    width: 100%;
}

/* ============================================
   FIX: New Message page must not use flex layout
   ============================================ */

.messaging-page .messaging-content {
    display: block !important;
    padding: 40px 20px;
}

.new-message-panel {
    max-width: 520px;
    margin: 0 auto;
}
/* ============================================
   Message Thread Styling
   ============================================ */

.message-thread {
    display: flex;
    flex-direction: column;
    gap: 20px;
    padding: 20px;
    background: #0f0f0f;
}

.message-bubble {
    max-width: 80%;
    padding: 14px 18px;
    border-radius: 14px;
    font-size: 15px;
    line-height: 1.5;
    position: relative;
    word-wrap: break-word;
    white-space: pre-wrap;
}

.message-bubble.sent {
    align-self: flex-end;
    background: #1a73e8;
    color: #fff;
    border-bottom-right-radius: 4px;
}

.message-bubble.received {
    align-self: flex-start;
    background: #222;
    color: #ccc;
    border-bottom-left-radius: 4px;
}

.message-meta {
    font-size: 12px;
    color: #888;
    margin-top: 6px;
    text-align: right;
}

.message-attachment {
    margin-top: 10px;
    font-size: 14px;
    color: #ccc;
    display: flex;
    align-items: center;
    gap: 8px;
}

.message-attachment a {
    color: #1a73e8;
    text-decoration: none;
    word-break: break-word;
}

.message-attachment a:hover {
    text-decoration: underline;
}

.message-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 20px;
}

.message-list-item {
    padding: 12px 16px;
    background: #111;
    border-radius: 10px;
    color: #ccc;
    text-decoration: none;
    display: flex;
    flex-direction: column;
    gap: 6px;
    box-shadow: 0 0 0 1px #222;
}

.message-list-item:hover {
    background: #1a1a1a;
    box-shadow: 0 0 0 1px #333;
}

.message-list-item .preview {
    font-size: 14px;
    color: #aaa;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.message-list-item .timestamp {
    font-size: 12px;
    color: #666;
    text-align: right;
}

