﻿@font-face {
    font-family: 'vazir';
    src: url('/Config/Fonts/Vazir.woff') format('woff');
}

@font-face {
    font-family: 'yekan';
    src: url('/Config/Fonts/Yekan.woff') format('woff');
}

:root {
    /* Color palette */
    --color-bg-primary: #0f0f10;
    --color-bg-secondary: #171717;
    --color-bg-tertiary: #232324;
    --color-bg-hover: #232324;
    --color-bg-active: #2d2d2f;
    --color-bg-input: #232324;
    --color-text-primary: #e8e6e3;
    --color-text-secondary: #a3a19d;
    --color-text-muted: #757370;
    --color-text-inverse: #1a1a1a;
    --color-border: #2a2a2c;
    --color-border-light: #38383a;
    --color-accent: #6ea8fe;
    --color-accent-hover: #8fbcff;
    --color-danger: #f87171;
    --color-success: #34d399;
    --color-scrollbar: #38383a;
    --color-scrollbar-hover: #48484a;
    /* Typography */
    --font-family-base: "vazir", Tahoma, "Segoe UI", sans-serif;
    --font-size-xs: 12px;
    --font-size-sm: 13px;
    --font-size-base: 14px;
    --font-size-md: 15px;
    --font-size-lg: 16px;
    --font-size-xl: 18px;
    --font-size-xxl: 22px;
    --line-height-base: 1.7;
    /* Spacing */
    --spacing-xs: 4px;
    --spacing-sm: 8px;
    --spacing-md: 12px;
    --spacing-lg: 16px;
    --spacing-xl: 24px;
    --spacing-xxl: 32px;
    /* Sizing */
    --sidebar-width: 260px;
    --sidebar-collapsed-width: 0px;
    --header-height: 56px;
    --radius-sm: 6px;
    --radius-md: 8px;
    --radius-lg: 12px;
    --radius-xl: 16px;
    --radius-full: 999px;
    /* Transitions */
    --transition-fast: 0.15s ease;
    --transition-base: 0.25s ease;
    --transition-slow: 0.4s ease;
    /* Shadows */
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.25);
    --shadow-md: 0 4px 14px rgba(0, 0, 0, 0.35);
    --shadow-lg: 0 10px 28px rgba(0, 0, 0, 0.45);
    /* Z-index layers */
    --z-sidebar: 100;
    --z-header: 200;
    --z-overlay: 300;
    --z-modal: 400;
    --z-toast: 500;
}

/* ===================================================================
   Light theme
=================================================================== */
html[data-theme="light"] {
    --color-bg-primary: #fcfcfc;
    --color-bg-secondary: #fcfcfc;
    --color-bg-tertiary: #f3f3f3;
    --color-bg-hover: #f0f0f0;
    --color-bg-active: #efefef;
    --color-bg-input: #ffffff;
    --color-text-primary: #0d0d0d;
    --color-text-secondary: #5d5d5d;
    --color-text-muted: #8e8e8e;
    --color-text-inverse: #ffffff;
    --color-border: #ececec;
    --color-border-light: #e3e3e3;
    --color-accent: #0d0d0d;
    --color-accent-hover: #2a2a2a;
    --color-danger: #dc4444;
    --color-success: #1f9d6f;
    --color-scrollbar: #d9d9d9;
    --color-scrollbar-hover: #c2c2c2;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.04);
    --shadow-md: 0 4px 14px rgba(0, 0, 0, 0.08);
    --shadow-lg: 0 10px 28px rgba(0, 0, 0, 0.12);
}

    html[data-theme="light"] .message-bubble.markdown-body pre {
        background-color: #f3f3f3;
    }

    html[data-theme="light"] .code-block-header {
        background-color: #f3f3f3;
        color: #5d5d5d;
    }

    html[data-theme="light"] .code-block-wrapper {
        border-color: #ececec;
    }
/* ===================================================================
   Reset & Base
=================================================================== */

* {
    box-sizing: border-box;
}

html, body {
    margin: 0;
    padding: 0;
    height: 100%;
    width: 100%;
}

body {
    font-family: var(--font-family-base);
    font-size: var(--font-size-base);
    line-height: var(--line-height-base);
    background-color: var(--color-bg-primary);
    color: var(--color-text-primary);
    direction: rtl;
    text-align: right;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    transition: background-color var(--transition-base), color var(--transition-base);
}

* {
    scrollbar-width: thin;
    scrollbar-color: var(--color-scrollbar) transparent;
}

    *::-webkit-scrollbar {
        width: 8px;
        height: 8px;
    }

    *::-webkit-scrollbar-track {
        background: transparent;
    }

    *::-webkit-scrollbar-thumb {
        background-color: var(--color-scrollbar);
        border-radius: var(--radius-full);
    }

        *::-webkit-scrollbar-thumb:hover {
            background-color: var(--color-scrollbar-hover);
        }

/* ===================================================================
   Base element styles
=================================================================== */

a {
    color: var(--color-text-primary);
    text-decoration: none;
    transition: color var(--transition-fast);
}

    a:hover {
        color: var(--color-text-secondary);
    }

h1, h2, h3, h4, h5, h6 {
    margin: 0;
    font-weight: 600;
    color: var(--color-text-primary);
}

p {
    margin: 0;
}

ul, ol {
    margin: 0;
    padding: 0;
    list-style: none;
}

button {
    font-family: inherit;
    font-size: inherit;
    border: none;
    background: none;
    cursor: pointer;
    color: var(--color-text-primary);
}

    button:disabled {
        cursor: not-allowed;
        opacity: 0.5;
    }

input[type="text"],
input[type="search"],
input[type="password"],
input[type="email"],
textarea {
    font-family: inherit;
    font-size: var(--font-size-md);
    color: var(--color-text-primary);
    background-color: var(--color-bg-input);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    padding: var(--spacing-md) var(--spacing-lg);
    outline: none;
    direction: rtl;
    text-align: right;
    transition: border-color var(--transition-fast), background-color var(--transition-fast);
}

    input[type="text"]::placeholder,
    input[type="search"]::placeholder,
    textarea::placeholder {
        color: var(--color-text-muted);
    }

    input[type="text"]:focus,
    input[type="search"]:focus,
    input[type="password"]:focus,
    input[type="email"]:focus,
    textarea:focus {
        border-color: var(--color-border-light);
        background-color: var(--color-bg-tertiary);
    }

textarea {
    resize: none;
}

img {
    max-width: 100%;
    display: block;
}

svg {
    display: block;
    fill: none;
}

/* ===================================================================
   Utility classes
=================================================================== */

.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.flex {
    display: flex;
}

.flex-col {
    flex-direction: column;
}

.items-center {
    align-items: center;
}

.justify-between {
    justify-content: space-between;
}

.truncate {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Generic spinner */
.spinner {
    display: inline-block;
    width: 18px;
    height: 18px;
    border: 2px solid var(--color-border-light);
    border-top-color: var(--color-text-primary);
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
}

.spinner-lg {
    width: 32px;
    height: 32px;
    border-width: 3px;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}
