/* Local Vazirmatn Fonts (Persian) */
:root {
    /* DARK THEME (Default) */
    --bg-base: #0d1b2e;
    --bg-panel: #1a2c4e;
    --bg-hover: #2a3b5c;
    --bg-sidebar: #0f1c30;
    --accent: #c9821a;
    --accent-rgb: 201 130 26;
    --text-on-accent: #0d1b2e;                    /* Navy text on gold background */
    --text-main: #ffffff;
    --text-muted: rgba(255, 255, 255, 0.6);      /* text-gray-400 equivalent */
    --text-muted-hover: rgba(255, 255, 255, 0.8); /* text-gray-300 equivalent */
    --text-muted-dim: rgba(255, 255, 255, 0.4);   /* text-gray-500 equivalent */
    --border-color: rgba(255, 255, 255, 0.05);    /* border-white/5 */
    --border-hover: rgba(255, 255, 255, 0.1);     /* border-white/10 */
    --border-active: rgba(255, 255, 255, 0.2);    /* border-white/20 */
    --overlay: rgba(255, 255, 255, 0.05);         /* bg-white/5 */
    --overlay-hover: rgba(255, 255, 255, 0.1);    /* bg-white/10 */
    --black-20: rgba(0, 0, 0, 0.2);               /* bg-black/20 */
    --black-50: rgba(0, 0, 0, 0.5);               /* bg-black/50 */
}

body.theme-light {
    /* LIGHT THEME */
    --bg-base: #f1f5f9;                           /* Very light cool gray */
    --bg-panel: #ffffff;                          /* Pure white */
    --bg-hover: #e2e8f0;                          /* Light hover gray */
    --bg-sidebar: #f8fafc;                        /* Off-white sidebar */
    --accent: #c9821a;                            /* Gold for light theme */
    --accent-rgb: 201 130 26;
    --text-on-accent: #0d1b2e;                    /* Navy text on gold background */
    --text-main: #0f172a;                         /* Very dark slate */
    --text-muted: #64748b;                        /* Muted slate */
    --text-muted-hover: #475569;                  /* Darker slate hover */
    --text-muted-dim: #94a3b8;                    /* Dimmer slate */
    --border-color: rgba(0, 0, 0, 0.08);          /* Light dark border */
    --border-hover: rgba(0, 0, 0, 0.15);
    --border-active: rgba(0, 0, 0, 0.25);
    --overlay: rgba(0, 0, 0, 0.04);
    --overlay-hover: rgba(0, 0, 0, 0.08);
    --black-20: rgba(255, 255, 255, 0.5);         /* Invert for modals */
    --black-50: rgba(255, 255, 255, 0.8);         /* Invert for modals */
}

@font-face {
    font-family: 'Vazirmatn';
    src: url('fonts/Vazirmatn-Regular.ttf') format('truetype');
    font-weight: normal;
    font-style: normal;
}
@font-face {
    font-family: 'Vazirmatn';
    src: url('fonts/Vazirmatn-Bold.ttf') format('truetype');
    font-weight: bold;
    font-style: normal;
}
@font-face {
    font-family: 'Vazirmatn';
    src: url('fonts/Vazirmatn-Black.ttf') format('truetype');
    font-weight: 900;
    font-style: normal;
}

/* Global styles - Persian + English pairing */
body {
    font-family: 'Vazirmatn', 'Segoe UI', system-ui, sans-serif;
    background-color: transparent;
}

/* English text uses Segoe UI for crisp rendering */
:lang(en), input, button {
    font-family: 'Vazirmatn', 'Segoe UI', system-ui, sans-serif;
}

.title-font {
    font-family: 'Vazirmatn', 'Segoe UI', sans-serif;
    letter-spacing: 0.05em;
}

/* Custom Gold Checkbox */
.gold-checkbox {
    appearance: none;
    -webkit-appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 6px;
    border: 2px solid rgba(201, 130, 26, 0.5);
    background: rgba(255, 255, 255, 0.05);
    cursor: pointer;
    position: relative;
    transition: all 0.2s ease;
    flex-shrink: 0;
}
.gold-checkbox:hover {
    border-color: #c9821a;
    background: rgba(201, 130, 26, 0.1);
}
.gold-checkbox:checked {
    background: linear-gradient(135deg, #c9821a, #e6a830);
    border-color: #c9821a;
    box-shadow: 0 0 8px rgba(201, 130, 26, 0.4);
}
.gold-checkbox:checked::after {
    content: '';
    position: absolute;
    left: 5px;
    top: 2px;
    width: 6px;
    height: 10px;
    border: 2px solid #0d1b2e;
    border-top: none;
    border-left: none;
    transform: rotate(45deg);
}

/* Frameless Window Dragging Support */
#titlebar {
    -webkit-app-region: drag;
}

.window-controls button {
    -webkit-app-region: no-drag;
}

/* Custom Scrollbar (Global - Telegram style) */
::-webkit-scrollbar {
    width: 12px;
    height: 12px;
}
::-webkit-scrollbar-track {
    background: transparent;
    margin-top: 4px;
    margin-bottom: 4px;
}
::-webkit-scrollbar-thumb {
    background: rgba(201, 130, 26, 0.25);
    border-radius: 12px;
    border: 3px solid transparent;
    background-clip: padding-box;
    min-height: 48px;
    transition: background 0.15s ease, border-width 0.15s ease;
}
::-webkit-scrollbar-thumb:hover {
    background: rgba(201, 130, 26, 0.75);
    border: 1px solid transparent;
}
::-webkit-scrollbar-thumb:active {
    background: rgba(201, 130, 26, 0.95);
    border: 0px solid transparent;
}

/* Chat messages scrollbar - Telegram dynamic interactive expand */
#chat-messages::-webkit-scrollbar {
    width: 14px;
}
#chat-messages::-webkit-scrollbar-track {
    background: transparent;
}
#chat-messages::-webkit-scrollbar-thumb {
    background: rgba(201, 130, 26, 0.25);
    border-radius: 14px;
    border: 4px solid transparent;
    background-clip: padding-box;
    min-height: 48px;
    transition: background 0.15s ease, border-width 0.15s ease;
}
#chat-messages:hover::-webkit-scrollbar-thumb {
    background: rgba(201, 130, 26, 0.45);
    border: 3px solid transparent;
}
#chat-messages::-webkit-scrollbar-thumb:hover {
    background: rgba(201, 130, 26, 0.85);
    border: 1px solid transparent;
}
#chat-messages::-webkit-scrollbar-thumb:active {
    background: #c9821a;
    border: 0px solid transparent;
}

/* Sidebar contact list scrollbar */
#contact-list::-webkit-scrollbar {
    width: 12px;
}
#contact-list::-webkit-scrollbar-track {
    background: transparent;
}
#contact-list::-webkit-scrollbar-thumb {
    background: rgba(201, 130, 26, 0.2);
    border-radius: 12px;
    border: 3px solid transparent;
    background-clip: padding-box;
    min-height: 40px;
    transition: background 0.15s ease, border-width 0.15s ease;
}
#contact-list:hover::-webkit-scrollbar-thumb {
    background: rgba(201, 130, 26, 0.4);
    border: 2px solid transparent;
}
#contact-list::-webkit-scrollbar-thumb:hover {
    background: rgba(201, 130, 26, 0.8);
    border: 1px solid transparent;
}
#contact-list::-webkit-scrollbar-thumb:active {
    background: #c9821a;
    border: 0px solid transparent;
}

/* Telegram chat pattern */
.pattern-bg {
    background-image: url('data:image/svg+xml,%3Csvg width="60" height="60" viewBox="0 0 60 60" xmlns="http://www.w3.org/2000/svg"%3E%3Cg fill="none" fill-rule="evenodd"%3E%3Cg fill="%23d6e2eb" fill-opacity="0.4"%3E%3Cpath d="M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z"/%3E%3C/g%3E%3C/g%3E%3C/svg%3E');
}

/* ========================================= */
/* PWA & Mobile Styles (Strictly Isolated)   */
/* ========================================= */
@media (max-width: 768px) {
    /* Hide hover tooltips on mobile since there is no hover */
    .group-hover\:opacity-100 {
        display: none !important;
    }
    
    /* Make scrollbars invisible on mobile to save space */
    ::-webkit-scrollbar {
        width: 0px !important;
        background: transparent !important;
    }
    
    /* Prevent text selection and highlight on mobile tap */
}

/* Hardware-clipped Rounded Window Corners for Desktop (Fixes Chromium corner bleed during scroll & pin) */
html.desktop-app #main-screen,
.is-desktop-app #main-screen,
#main-screen {
    border-radius: 24px;
    overflow: hidden;
    transform: translateZ(0);
    isolation: isolate;
    -webkit-mask-image: -webkit-radial-gradient(white, black);
}

/* Suppress all native Chromium/WebKit video playback buttons & default posters */
video::-webkit-media-controls,
video::-webkit-media-controls-enclosure,
video::-webkit-media-controls-panel,
video::-webkit-media-controls-play-button,
video::-webkit-media-controls-start-playback-button,
video::-webkit-media-controls-overlay-play-button {
    display: none !important;
    -webkit-appearance: none !important;
    opacity: 0 !important;
    pointer-events: none !important;
}

