/**
 * Woopze Main Styles
 * Ana stil dosyası - Reset, Variables, Base
 */

/* ==================== CSS VARIABLES ==================== */
:root {
    /* Colors - Primary */
    --primary: #3b5998;
    --primary-dark: #2d4373;
    --primary-light: #4a90a4;
    
    /* Colors - Secondary */
    --secondary: #5dade2;
    --secondary-dark: #3498db;
    
    /* Colors - Accent */
    --accent: #669999;
    --accent-light: #a8d8d8;
    
    /* Colors - Status */
    --success: #27ae60;
    --success-light: #2ecc71;
    --danger: #e74c3c;
    --danger-light: #ff6b6b;
    --warning: #e67e22;
    --warning-light: #f39c12;
    --info: #3498db;
    --info-light: #5dade2;
    
    /* Colors - Neutral */
    --white: #ffffff;
    --black: #000000;
    --gray-50: #f8f9fa;
    --gray-100: #f1f3f5;
    --gray-200: #e9ecef;
    --gray-300: #dee2e6;
    --gray-400: #ced4da;
    --gray-500: #adb5bd;
    --gray-600: #868e96;
    --gray-700: #495057;
    --gray-800: #343a40;
    --gray-900: #212529;
    
    /* Colors - Background */
    --bg-body: #f5f6fa;
    --bg-sidebar: #1a1a2e;
    --bg-card: #ffffff;
    --bg-header: #ffffff;
    
    /* Colors - Text */
    --text-primary: #212529;
    --text-secondary: #6c757d;
    --text-muted: #adb5bd;
    --text-light: #ffffff;
    
    /* Colors - Border */
    --border-color: #e9ecef;
    --border-dark: #dee2e6;
    
    /* Spacing */
    --spacing-xs: 4px;
    --spacing-sm: 8px;
    --spacing-md: 16px;
    --spacing-lg: 24px;
    --spacing-xl: 32px;
    --spacing-2xl: 48px;
    
    /* Border Radius - Woopze'da 0! */
    --radius: 0;
    --radius-sm: 0;
    --radius-lg: 0;
    
    /* Shadows */
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
    --shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.1);
    
    /* Typography */
    --font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    --font-size-xs: 11px;
    --font-size-sm: 12px;
    --font-size-md: 14px;
    --font-size-lg: 16px;
    --font-size-xl: 18px;
    --font-size-2xl: 24px;
    --font-size-3xl: 32px;
    
    /* Transitions */
    --transition-fast: 150ms ease;
    --transition: 200ms ease;
    --transition-slow: 300ms ease;
    
    /* Layout */
    --sidebar-width: 260px;
    --sidebar-collapsed-width: 70px;
    --header-height: 60px;
    
    /* Z-Index */
    --z-dropdown: 100;
    --z-sticky: 200;
    --z-fixed: 300;
    --z-modal-backdrop: 400;
    --z-modal: 500;
    --z-popover: 600;
    --z-tooltip: 700;
    --z-loading: 1000;
}

/* ==================== RESET ==================== */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: 14px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: var(--font-family);
    font-size: var(--font-size-md);
    color: var(--text-primary);
    background-color: #fcfcfd;
    line-height: 1.5;
    min-height: 100vh;
}

.btn-list{display:flex;align-items: center;gap: 8px;}

a {
    color: var(--primary);
    text-decoration: none;
    transition: color var(--transition-fast);
}

a:hover {
    color: var(--primary-dark);
}

img {
    max-width: 100%;
    height: auto;
}

button {
    font-family: inherit;
    cursor: pointer;
    border: none;
    background: none;
}

input, select, textarea {
    font-family: inherit;
    font-size: inherit;
}

ul, ol {
    list-style: none;
}

/* ==================== LAYOUT ==================== */
#app-container {
    display: flex;
    min-height: 100vh;
}

#main-content {
    flex: 1;
    margin-left: var(--sidebar-width);
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    transition: margin-left var(--transition);
}

#app-container.sidebar-collapsed #main-content {
    margin-left: var(--sidebar-collapsed-width);
}

#page-content {
    flex: 1;
    margin-top: 24px;
}

/* ==================== LOADING OVERLAY ==================== */
#loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: var(--z-loading);
    opacity: 0;
    visibility: hidden;
    transition: opacity var(--transition), visibility var(--transition);
}

#loading-overlay.show {
    opacity: 1;
    visibility: visible;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--gray-200);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ==================== SCROLLBAR ==================== */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--gray-100);
}

::-webkit-scrollbar-thumb {
    background: var(--gray-400);
}

::-webkit-scrollbar-thumb:hover {
    background: var(--gray-500);
}

/* ==================== RESPONSIVE ==================== */
@media (max-width: 992px) {
    #main-content {
        margin-left: 0;
    }
    
    #sidebar {
        transform: translateX(-100%);
    }
    
    #sidebar.open {
        transform: translateX(0);
    }
}

/* ==================== NAV GRID LIST ==================== */
/* Tablo görünümlü sürüklenebilir liste */
.nav-grid-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-bottom: none;
    font-size: 11px;
    font-weight: 600;
    color: #64748b;
    text-transform: uppercase;
}
.nav-grid-list {
    border: 1px solid #e2e8f0;
}
.nav-grid-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: white;
    border-bottom: 1px solid #e2e8f0;
    font-size: 13px;
}
.nav-grid-item:last-child {
    border-bottom: none;
}
.nav-grid-item:hover {
    background: #f8fafc;
}
.nav-grid-item .drag-handle {
    width: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #000000;
    cursor: grab;
}
.nav-grid-item .drag-handle:hover {
    color: #94a3b8;
}
.nav-grid-item .drag-handle:active {
    cursor: grabbing;
}
.nav-grid-item .drag-handle svg {
    width: 16px;
    height: 16px;
}
.nav-grid-item .col-icon {
    width: 50px;
}
.nav-grid-item .col-name {
    flex: 1;
    min-width: 0;
}
.nav-grid-item .col-type {
    width: 80px;
}
.nav-grid-item .col-status {
    width: 60px;
}
.nav-grid-item .col-view {
    width: 60px;
}
.nav-grid-item .col-actions {
    width: 120px;
    display: flex;
    gap: 4px;
}

/* Drag & Drop - Elastic Effect */
.nav-grid-item[draggable="true"] {
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    user-select: none;
}
.nav-grid-list.dragging-active .nav-grid-item:hover {
    background: white;
}
.nav-grid-item.dragging {
    opacity: 0.4;
    background: #f0f9ff;
}
.nav-grid-item:not(.dragging) {
    transition: transform 300ms cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* Nav Icon */
.nav-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    background: #f1f5f9;
    border-radius: 8px;
    flex-shrink: 0;
}
.nav-icon svg {
    width: 20px;
    height: 20px;
}
.nav-icon.empty {
    background: #f8fafc;
    border: 1px dashed #e2e8f0;
}
.nav-icon.empty svg {
    color: #cbd5e1;
}

/* Path Badge */
.path-badge {
    display: inline-flex;
    padding: 2px 8px;
    background: #f1f5f9;
    border-radius: 4px;
    font-size: 11px;
    color: #64748b;
    font-family: monospace;
}
.path-badge.url {
    background: #dbeafe;
    color: #2563eb;
}

/* Type Badge */
.type-badge {
    display: inline-flex;
    padding: 4px 10px;
    background: #f1f5f9;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 500;
    color: #64748b;
    text-transform: uppercase;
}
.type-badge.title {
    background: #fef3c7;
    color: #b45309;
}
.type-badge.item {
    background: #dbeafe;
    color: #1d4ed8;
}

/* Alt menü + butonu */
.icon-btn.add-child {
    opacity: 0.4;
}
.icon-btn.add-child:hover {
    opacity: 1;
}

/* Checkbox Grid - Department page */
.checkbox-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 8px;
    max-height: 200px;
    overflow-y: auto;
    padding: 12px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
}

.checkbox-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 4px;
    cursor: pointer;
    font-size: 13px;
    transition: all 0.15s ease;
}

.checkbox-item:hover {
    border-color: #94a3b8;
}

.checkbox-item:has(input:checked) {
    background: #eef2ff;
    border-color: #818cf8;
    color: #4f46e5;
}

.checkbox-item input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: #4f46e5;
}

/* Nav Tree - Department authorization */
.nav-tree {
    max-height: 350px;
    overflow-y: auto;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    background: #f8fafc;
}

.nav-tree-item {
    padding: 8px 12px;
    border-bottom: 1px solid #e2e8f0;
}

.nav-tree-item:last-child {
    border-bottom: none;
}

.tree-checkbox {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-size: 13px;
}

.tree-checkbox input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: #4f46e5;
    cursor: pointer;
}

.tree-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    cursor: pointer;
    transition: transform 0.2s ease;
}

.tree-toggle .chevron {
    width: 14px;
    height: 14px;
    color: #64748b;
    transition: transform 0.2s ease;
}

.tree-toggle.collapsed .chevron {
    transform: rotate(-90deg);
}

.tree-spacer {
    width: 20px;
    height: 20px;
}

.tree-label {
    flex: 1;
    color: #334155;
}

.tree-badge {
    font-size: 10px;
    padding: 2px 6px;
    background: #fef3c7;
    color: #92400e;
    border-radius: 4px;
    font-weight: 500;
}

.nav-tree-children {
    background: white;
    border-left: 2px solid #e2e8f0;
    margin-left: 12px;
}

.nav-tree-children.collapsed {
    display: none;
}

.nav-tree-children .nav-tree-item {
    background: white;
}

.nav-tree-children .nav-tree-item:hover {
    background: #f1f5f9;
}

/* Nav Tree Simple - Clean checkbox list */
.nav-tree-simple {
    max-height: 400px;
    overflow-y: auto;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    background: #fafafa;
}

.nav-tree-simple .tree-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 2px 12px;
    cursor: pointer;
    font-size: 12px;
    color: #374151;
    border-bottom: 1px solid #f3f4f6;
    transition: background 0.15s;
}

.nav-tree-simple .tree-item:last-child {
    border-bottom: none;
}

.nav-tree-simple .tree-item:hover {
    background: #f3f4f6;
}

.nav-tree-simple .tree-item input[type="checkbox"] {
    width: 14px;
    height: 14px;
    accent-color: #3b82f6;
    cursor: pointer;
    flex-shrink: 0;
}

.nav-tree-simple .tree-item span {
    flex: 1;
}

/* Popup outline button */
.popup-btn-outline {
    padding: 10px 24px;
    font-size: 14px;
    font-weight: 500;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    background: white;
    color: #374151;
    cursor: pointer;
    transition: all 0.15s;
}

.popup-btn-outline:hover {
    background: #f9fafb;
    border-color: #d1d5db;
}

/* Checkbox Row - Popup içinde satır */
.checkbox-row {
    display: flex;
    align-items: center;
    gap: 8px;
}

.checkbox-row .checkbox-label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-size: 14px;
    color: #374151;
}

.checkbox-row .checkbox-label input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: #3b82f6;
    cursor: pointer;
}

/* Status Badge */
.status-badge {
    display: inline-block;
    padding: 4px 10px;
    font-size: 12px;
    font-weight: 500;
    border-radius: 20px;
}

.status-badge.active {
    background: #dcfce7;
    color: #16a34a;
}

.status-badge.passive {
    background: #fee2e2;
    color: #dc2626;
}

/* Type Badge variants */
.type-badge.credit {
    background: #fef3c7;
    color: #d97706;
}

.type-badge.free {
    background: #dbeafe;
    color: #2563eb;
}

/* Search Box in btn-list */
.btn-list .search-box {
    display: flex;
    align-items: center;
    gap: 8px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 0 12px;
    min-width: 200px;
}

.btn-list .search-box svg {
    width: 16px;
    height: 16px;
    color: #94a3b8;
    flex-shrink: 0;
}

.btn-list .search-box input {
    border: none;
    outline: none;
    background: transparent;
    font-size: 13px;
    color: #1e293b;
    padding: 8px 0;
    width: 100%;
}

.btn-list .search-box input::placeholder {
    color: #94a3b8;
}

/* Detail Page Styles */
.detail-content {
    overflow: hidden;
}

.detail-tabs {
    display: flex;
    border-bottom: 1px solid #e5e7eb;
    background: #f8fafc;
    padding: 0 16px;
    gap: 4px;
    overflow-x: auto;
}

.tab-btn {
    padding: 14px 20px;
    border: none;
    background: transparent;
    color: #64748b;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    border-bottom: 2px solid transparent;
    transition: all 0.15s;
    white-space: nowrap;
}

.tab-btn:hover {
    color: #1e293b;
}

.tab-btn.active {
    color: #3b82f6;
    border-bottom-color: #3b82f6;
    background: white;
}

.tab-panel {
    display: none;
    padding: 0;
}

.tab-panel.active {
    display: block;
}

.form-section {
    margin-bottom: 32px;
}

.form-section:last-child {
    margin-bottom: 0;
}

.section-title {
    font-size: 15px;
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 16px;
    padding-bottom: 8px;
    border-bottom: 1px solid #f1f5f9;
}

/* Input Row */
.input-row {
    display: flex;
    gap: 16px;
}

@media (max-width: 640px) {
    .input-row {
        flex-direction: column;
    }
}

/* Primary button variant */
.text-btn.primary {
    background: #3b82f6;
    color: white;
}

.text-btn.primary:hover {
    background: #2563eb;
}

/* Tab Panel Styles */
.tab-panels {
    padding: 4px;
    margin-top: 32px;
}

.tab-panel {
    display: none;
}

.tab-panel.active {
    display: block;
}

/* Section desc */
.section-desc {
    color: #64748b;
    font-size: 13px;
    margin-bottom: 12px;
}
