@import url('open-iconic/font/css/open-iconic-bootstrap.min.css');
@import url('./icons.css');

: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;
    --space-2: 0.5rem;
    --space-3: 0.75rem;
    --space-4: 1rem;
    --space-5: 1.5rem;
    --space-6: 2rem;
    --space-8: 3rem;

    /* 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 (Bootstrap üstüne eşleme) */
    --color-brand: #0d6efd;
    --color-brand-soft: rgba(13, 110, 253, 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;
    --font-size-sm: 0.875rem;
    --font-size-base: 1rem;
    --font-size-lg: 1.125rem;
    --font-size-xl: 1.5rem;
    --font-size-2xl: 2rem;

    /* 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%;
}

/* Shimmer skeleton loading */
.shimmer-line {
    height: 14px;
    border-radius: 4px;
    background: #e9ecef;
    background-image: linear-gradient(90deg, #e9ecef 0%, #f8f9fa 40%, #e9ecef 80%);
    background-size: 600px 100%;
    animation: shimmer 1.4s ease-in-out infinite;
}

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

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

.shimmer-block {
    border-radius: 6px;
    background: #e9ecef;
    background-image: linear-gradient(90deg, #e9ecef 0%, #f8f9fa 40%, #e9ecef 80%);
    background-size: 600px 100%;
    animation: shimmer 1.4s ease-in-out infinite;
}

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

/* DxPopup mobile tuning: iç padding mobilde daraltılır */
@media (max-width: 575.98px) {
    .dxbl-popup .dxbl-popup-content {
        padding: 0.75rem !important;
    }
}

/* DxGrid mobilde overflow scroll garantile — asla layout kırma */
@media (max-width: 767.98px) {
    .dxbl-grid {
        max-width: 100%;
    }
}

/* PageHeader */
.page-header {
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
    padding: var(--space-3) 0 var(--space-4);
    border-bottom: 1px solid var(--color-border);
    margin-bottom: var(--space-4);
}

@media (min-width: 768px) {
    .page-header {
        padding: var(--space-4) 0 var(--space-5);
        margin-bottom: var(--space-5);
    }
}

.page-header-row {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: var(--space-3);
}

@media (min-width: 768px) {
    .page-header-row {
        flex-direction: row;
        align-items: flex-start;
        justify-content: space-between;
        gap: var(--space-4);
        flex-wrap: wrap;
    }
}

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

@media (min-width: 768px) {
    .page-header-title {
        font-size: var(--font-size-2xl);
    }
}

.page-header-subtitle {
    font-size: var(--font-size-sm);
    color: var(--color-muted);
    margin: 0;
}

@media (min-width: 768px) {
    .page-header-subtitle {
        font-size: var(--font-size-base);
    }
}

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

/* Mobile: aksiyon butonlarini tam genislikli stack yapabilelim */
@media (max-width: 767.98px) {
    .page-header-actions > * {
        flex: 1 1 auto;
    }
}

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

@media (max-width: 575.98px) {
    .page-breadcrumb {
        font-size: var(--font-size-xs);
    }
}

.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 {
    opacity: 0.5;
}

.page-breadcrumb .breadcrumb-current {
    color: #212529;
    font-weight: 500;
}

/* EmptyState */
.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: var(--space-8) var(--space-5);
    gap: var(--space-3);
    color: var(--color-muted);
}

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

.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);
    margin: 0;
    max-width: 480px;
}

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

/* Abbreviation tooltip */
.abbr-tooltip {
    border-bottom: 1px dotted var(--color-muted);
    cursor: help;
    text-decoration: none;
}

/* Command Palette trigger (header button) */
.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;
}

@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;
    }
}

/* Command Palette */
.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);
    font-family: ui-monospace, Menlo, Monaco, monospace;
}

.command-palette-item.active .command-palette-item-path {
    color: var(--color-brand);
    opacity: 0.7;
}

.command-palette-hint {
    color: #495057 !important;
}

.command-palette-hint kbd {
    background: #ffffff;
    border: 1px solid #adb5bd;
    box-shadow: 0 1px 0 rgba(0, 0, 0, 0.1);
    border-radius: 3px;
    padding: 1px 6px;
    font-size: var(--font-size-xs);
    font-family: ui-monospace, Menlo, Monaco, monospace;
    color: #212529;
    font-weight: 600;
}
