@import url('./icons.css');

/* ============================================================
   DESIGN TOKENS (:root)
   Tüm UI ekstralarımız bu token'ları kullanır.
   DevExpress teması override edilmez; ekstralar token tabanlı.
   ============================================================ */
:root {
    /* Popup boyut standardı — min() ile viewport'a göre daralır, mobilde taşmaz */
    --popup-sm: min(480px, calc(100vw - 1rem));
    --popup-md: min(640px, calc(100vw - 1rem));
    --popup-lg: min(900px, calc(100vw - 1rem));
    --popup-xl: min(1120px, calc(100vw - 1rem));
    --popup-max-height: 90vh;

    /* Spacing ölçeği */
    --space-1: 0.25rem;   /* 4px  */
    --space-2: 0.5rem;    /* 8px  */
    --space-3: 0.75rem;   /* 12px */
    --space-4: 1rem;      /* 16px */
    --space-5: 1.5rem;    /* 24px */
    --space-6: 2rem;      /* 32px */
    --space-8: 3rem;      /* 48px */

    /* Radius */
    --radius-sm: 4px;
    --radius-md: 6px;
    --radius-lg: 10px;

    /* Gölge */
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 8px rgba(0, 0, 0, 0.08);
    --shadow-lg: 0 12px 24px rgba(0, 0, 0, 0.12);

    /* Brand renkleri — Pulsify indigo */
    --color-brand: #4f46e5;
    --color-brand-soft: rgba(79, 70, 229, 0.12);
    --color-success: #198754;
    --color-warning: #ffc107;
    --color-danger: #dc3545;
    --color-danger-soft: rgba(220, 53, 69, 0.10);
    --color-muted: #6c757d;
    --color-surface: #ffffff;
    --color-surface-muted: #f8f9fa;
    --color-border: #dee2e6;

    /* Typography */
    --font-size-xs: 0.75rem;     /* 12px */
    --font-size-sm: 0.875rem;    /* 14px */
    --font-size-base: 1rem;      /* 16px */
    --font-size-lg: 1.125rem;    /* 18px */
    --font-size-xl: 1.5rem;      /* 24px */
    --font-size-2xl: 2rem;       /* 32px */

    /* Z-index */
    --z-dropdown: 1000;
    --z-sticky: 1020;
    --z-popup: 1050;
    --z-toast: 1100;
}

html, body {
    display: flex;
    flex-direction: column;
    height: 100%;
    overflow: hidden;
}

.valid.modified:not([type=checkbox]) {
    outline: 1px solid #26b050;
}

.invalid {
    outline: 1px solid red;
}

.validation-message {
    color: red;
}

.button-link {
    text-decoration: unset;
}

.title {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    padding: 1rem 0;
}

.title.title-secondary {
    padding: 0.313rem 0 0;
    color: var(--bs-secondary-color);
}

.title-header-text {
    font-size: 2rem;
    font-weight: 700;
    letter-spacing: 0;
    line-height: 2.5rem;
}

.title-content-text {
    font-size: 1rem;
    font-weight: 400;
    letter-spacing: 0;
    line-height: 1.375rem;
}

.main-content {
    align-items: center;
    display: flex;
    height: 100%;
    justify-content: center;
    width: 100%;
}

/* Login layout: scoped CSS lives in Pages/Login.razor.css.
   The wrapper just yields the full viewport and lets the page scroll on narrow screens. */
.login-layout {
    min-height: 100vh;
    width: 100%;
    overflow-y: auto;
}

/* DevExpress Menu Hover - Sidebar */
.dxbl-menu .dxbl-btn:hover,
.dxbl-menu .dxbl-menu-item:hover,
.dxbl-menu button[role="menuitem"]:hover {
    background-color: rgba(255, 255, 255, 0.1) !important;
}

/* DevExpress Menu Dropdown Popup Hover (Plans, Usage dropdown) */
.dxbl-menu-dropdown .dxbl-btn:hover,
.dxbl-menu-dropdown .dxbl-menu-item:hover,
.dxbl-popup .dxbl-btn:hover,
.dxbl-popup .dxbl-menu-item:hover,
.dxbl-dropdown-dialog .dxbl-btn:hover {
    background-color: rgba(0, 0, 0, 0.06) !important;
}

.dxbl-menu .dxbl-btn,
.dxbl-menu-dropdown .dxbl-btn,
.dxbl-popup .dxbl-btn {
    transition: background-color 0.15s ease;
}

/* ============================================================
   PAGE HEADER
   PageTitle altında, içerikten önce gelen başlık bloğu.
   Breadcrumb → Title+Subtitle → Actions yapısı.
   ============================================================ */
.page-header {
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
    padding: var(--space-4) 0 var(--space-5) 0;
    border-bottom: 1px solid var(--color-border);
    margin-bottom: var(--space-5);
}

.page-breadcrumb {
    font-size: var(--font-size-sm);
    color: var(--color-muted);
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--space-1);
}

.page-breadcrumb a {
    color: var(--color-muted);
    text-decoration: none;
}

.page-breadcrumb a:hover {
    color: var(--color-brand);
    text-decoration: underline;
}

.page-breadcrumb .breadcrumb-separator {
    color: var(--color-border);
    margin: 0 var(--space-1);
}

.page-breadcrumb .breadcrumb-current {
    color: var(--color-surface);
    color: #212529;
    font-weight: 600;
}

.page-header-row {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    justify-content: space-between;
    gap: var(--space-3);
}

.page-header-title {
    font-size: var(--font-size-2xl);
    font-weight: 700;
    margin: 0;
    line-height: 1.2;
    color: #212529;
}

/* FocusOnNavigate h1'e programmatic focus uygular (a11y).
   Klavye Tab focus'u korunur, otomatik focus outline'ı gizlenir. */
.page-header-title:focus:not(:focus-visible) {
    outline: none;
}

.page-header-subtitle {
    font-size: var(--font-size-base);
    color: var(--color-muted);
    margin: var(--space-1) 0 0 0;
    line-height: 1.4;
}

.page-header-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--space-2);
}

@media (max-width: 575.98px) {
    .page-header {
        padding: var(--space-3) 0 var(--space-4) 0;
        margin-bottom: var(--space-4);
    }
    .page-breadcrumb {
        font-size: var(--font-size-xs);
    }
    .page-header-title {
        font-size: var(--font-size-xl);
    }
    .page-header-subtitle {
        font-size: var(--font-size-sm);
    }
    .page-header-actions {
        flex: 1 1 auto;
        width: 100%;
    }
}

/* ============================================================
   EMPTY STATE
   Veri yok / sonuç yok durumlarında gösterilen merkezi blok.
   ============================================================ */
.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: var(--space-8) var(--space-4);
    color: var(--color-muted);
    gap: var(--space-3);
}

.empty-state-icon {
    font-size: 3rem;
    line-height: 1;
    color: var(--color-muted);
    opacity: 0.6;
}

.empty-state-title {
    font-size: var(--font-size-lg);
    font-weight: 600;
    color: #212529;
    margin: 0;
}

.empty-state-description {
    font-size: var(--font-size-sm);
    color: var(--color-muted);
    max-width: 32rem;
    margin: 0;
}

.empty-state-actions {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-2);
    justify-content: center;
    margin-top: var(--space-2);
}

/* ============================================================
   ABBR TOOLTIP
   Kısaltma + tooltip ile açıklama.
   ============================================================ */
.abbr-tooltip {
    border-bottom: 1px dotted var(--color-muted);
    cursor: help;
}

/* ============================================================
   SHIMMER / SKELETON
   İlk render için placeholder. Boş ekran yasak.
   ============================================================ */
.shimmer-line,
.shimmer-line-lg,
.shimmer-line-xl,
.shimmer-block {
    background-image: linear-gradient(90deg, #e9ecef 0%, #f8f9fa 40%, #e9ecef 80%);
    background-size: 200% 100%;
    animation: shimmer 1.4s ease-in-out infinite;
    display: block;
}

.shimmer-line {
    height: 14px;
    border-radius: 4px;
}

.shimmer-line-lg {
    height: 24px;
    border-radius: 4px;
}

.shimmer-line-xl {
    height: 36px;
    border-radius: 4px;
}

.shimmer-block {
    border-radius: 6px;
}

@keyframes shimmer {
    0% {
        background-position: 200% 0;
    }
    100% {
        background-position: -200% 0;
    }
}

/* ============================================================
   COMMAND PALETTE
   Ctrl/Cmd+K ile açılan hızlı arama ve gezinti paleti.
   ============================================================ */
.command-palette-body {
    padding: var(--space-2);
}

.command-palette-list {
    max-height: 400px;
    overflow-y: auto;
    outline: none;
}

.command-palette-group-header {
    font-size: var(--font-size-xs);
    font-weight: 700;
    text-transform: uppercase;
    color: #495057;
    letter-spacing: 0.05em;
    padding: var(--space-2) var(--space-3) var(--space-1);
    border-bottom: 1px solid var(--color-border);
    margin-top: var(--space-2);
    background: var(--color-surface-muted);
}

.command-palette-group-header:first-child {
    margin-top: 0;
}

.command-palette-item {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    width: 100%;
    padding: var(--space-2) var(--space-3);
    border: none;
    border-radius: var(--radius-sm);
    background: transparent;
    text-align: left;
    color: #212529;
    cursor: pointer;
    transition: background 0.1s ease;
}

.command-palette-item:hover,
.command-palette-item.active {
    background: var(--color-brand-soft);
    color: var(--color-brand);
}

.command-palette-item i {
    font-size: 1.1rem;
    flex-shrink: 0;
    width: 1.25rem;
    text-align: center;
}

.command-palette-item-text {
    flex: 1;
    font-weight: 500;
}

.command-palette-item-path {
    font-size: var(--font-size-xs);
    color: var(--color-muted);
}

/* Header'daki trigger butonu — keşfedilebilirlik için zorunlu */
.cmd-palette-trigger {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    background: var(--color-surface-muted);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    padding: 0.375rem 0.75rem;
    font-size: var(--font-size-sm);
    color: var(--color-muted);
    cursor: pointer;
    min-width: 0;
    flex-shrink: 1;
    transition: border-color 0.15s ease, color 0.15s ease;
}

@media (min-width: 768px) {
    .cmd-palette-trigger {
        min-width: 200px;
    }
}

.cmd-palette-trigger:hover {
    border-color: var(--color-brand);
    color: var(--color-brand);
}

.cmd-palette-trigger-label {
    flex: 1;
    text-align: left;
}

.cmd-palette-trigger-shortcut {
    background: #ffffff;
    border: 1px solid #adb5bd;
    box-shadow: 0 1px 0 rgba(0, 0, 0, 0.08);
    border-radius: 3px;
    padding: 1px 6px;
    font-size: var(--font-size-xs);
    color: #495057;
    font-family: ui-monospace, Menlo, Monaco, monospace;
    font-weight: 600;
}

@media (max-width: 640px) {
    .cmd-palette-trigger-label,
    .cmd-palette-trigger-shortcut {
        display: none;
    }
    .cmd-palette-trigger {
        min-width: auto;
        padding: 0.375rem;
    }
}
