/* ============================================
   Sayilarla Giresun - Ortak CSS Degiskenleri
   Giresun Universitesi Kurumsal Renkleri
   v4.0 - Dark Mode & Enhanced UI Support
   ============================================ */

:root {
    /* Primary Colors - Logo'dan alinmistir */
    --primary: #1B3A6D;
    --primary-light: #2B5A9E;
    --primary-dark: #0F2444;
    --primary-rgb: 27, 58, 109;

    /* Secondary Colors */
    --secondary: #4A9B4A;
    --secondary-light: #5CB85C;
    --secondary-rgb: 74, 155, 74;

    /* Accent Colors */
    --accent: #E8A838;
    --accent-orange: #D4872E;
    --purple: #7c3aed;
    --pink: #ec4899;

    /* State Colors */
    --danger: #ef4444;
    --warning: #f59e0b;
    --info: #3b82f6;
    --success: #10b981;

    /* Background Colors */
    --bg-dark: #0f172a;
    --bg-light: #f8fafc;
    --bg-body: #f8fafc;
    --sidebar-bg: #1e293b;
    --card-bg: #ffffff;
    --white: #ffffff;

    /* Text Colors */
    --text-dark: #1e293b;
    --text-light: #64748b;
    --text-muted: #94a3b8;
    --text-primary: #1e293b;

    /* Border Colors */
    --border: #e2e8f0;
    --border-light: #f1f5f9;

    /* Gradients */
    --gradient-primary: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
    --gradient-secondary: linear-gradient(135deg, var(--secondary) 0%, #3D8B3D 100%);
    --gradient-accent: linear-gradient(135deg, var(--accent) 0%, var(--accent-orange) 100%);

    /* Shadows */
    --shadow-sm: 0 1px 2px rgba(0,0,0,0.05);
    --shadow-md: 0 4px 6px -1px rgba(0,0,0,0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.1);
    --shadow-xl: 0 20px 25px -5px rgba(0,0,0,0.1);
    --shadow-glow: 0 0 20px rgba(var(--primary-rgb), 0.3);

    /* Typography */
    --font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --font-display: 'Playfair Display', Georgia, serif;

    /* Border Radius */
    --radius-sm: 4px;
    --radius-md: 8px;
    --radius-lg: 12px;
    --radius-xl: 16px;
    --radius-2xl: 24px;
    --radius-full: 9999px;

    /* Transitions */
    --transition-fast: 0.15s ease;
    --transition-normal: 0.2s ease;
    --transition-slow: 0.3s ease;

    /* Z-Index Scale */
    --z-dropdown: 100;
    --z-sticky: 500;
    --z-fixed: 1000;
    --z-modal: 1050;
    --z-tooltip: 1100;
    --z-toast: 1200;

    /* Sidebar */
    --sidebar-width: 260px;
    --sidebar-collapsed-width: 70px;

    /* Header */
    --header-height: 70px;

    /* Spacing Scale */
    --space-xs: 0.25rem;
    --space-sm: 0.5rem;
    --space-md: 1rem;
    --space-lg: 1.5rem;
    --space-xl: 2rem;
    --space-2xl: 3rem;
}

/* ============================================
   Dark Mode Variables
   ============================================ */
[data-theme="dark"] {
    --bg-body: #0f172a;
    --bg-light: #1e293b;
    --card-bg: #1e293b;
    --white: #1e293b;

    --text-dark: #f1f5f9;
    --text-light: #94a3b8;
    --text-muted: #64748b;
    --text-primary: #f1f5f9;

    --border: #334155;
    --border-light: #475569;

    --shadow-sm: 0 1px 2px rgba(0,0,0,0.3);
    --shadow-md: 0 4px 6px -1px rgba(0,0,0,0.4);
    --shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.4);
    --shadow-xl: 0 20px 25px -5px rgba(0,0,0,0.4);
}

/* ============================================
   Skeleton Loading Animation
   ============================================ */
@keyframes skeleton-loading {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

.skeleton {
    background: linear-gradient(90deg,
        var(--border-light) 25%,
        var(--border) 50%,
        var(--border-light) 75%
    );
    background-size: 200% 100%;
    animation: skeleton-loading 1.5s infinite;
    border-radius: var(--radius-md);
}

.skeleton-text {
    height: 1em;
    margin-bottom: 0.5em;
}

.skeleton-text:last-child {
    width: 80%;
}

.skeleton-circle {
    border-radius: 50%;
}

.skeleton-card {
    min-height: 180px;
}

/* ============================================
   Toast Notification System
   ============================================ */
.toast-container {
    position: fixed;
    bottom: 1.5rem;
    right: 1.5rem;
    z-index: var(--z-toast);
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    max-width: 400px;
}

.toast {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 1rem 1.25rem;
    background: var(--card-bg);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-xl);
    border-left: 4px solid var(--primary);
    opacity: 0;
    transform: translateX(100%);
    transition: all 0.3s ease;
}

.toast.show {
    opacity: 1;
    transform: translateX(0);
}

.toast.hiding {
    opacity: 0;
    transform: translateX(100%);
}

.toast-icon {
    flex-shrink: 0;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.toast-content {
    flex: 1;
}

.toast-title {
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: 0.25rem;
}

.toast-message {
    font-size: 0.875rem;
    color: var(--text-light);
}

.toast-close {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 0.25rem;
    line-height: 1;
    transition: color 0.2s;
}

.toast-close:hover {
    color: var(--text-dark);
}

.toast-progress {
    position: absolute;
    bottom: 0;
    left: 0;
    height: 3px;
    background: var(--primary);
    border-radius: 0 0 var(--radius-lg) var(--radius-lg);
    animation: toast-progress linear forwards;
}

@keyframes toast-progress {
    from { width: 100%; }
    to { width: 0%; }
}

/* Toast Types */
.toast.success { border-left-color: var(--success); }
.toast.success .toast-icon { background: rgba(16, 185, 129, 0.1); color: var(--success); }

.toast.error { border-left-color: var(--danger); }
.toast.error .toast-icon { background: rgba(239, 68, 68, 0.1); color: var(--danger); }

.toast.warning { border-left-color: var(--warning); }
.toast.warning .toast-icon { background: rgba(245, 158, 11, 0.1); color: var(--warning); }

.toast.info { border-left-color: var(--info); }
.toast.info .toast-icon { background: rgba(59, 130, 246, 0.1); color: var(--info); }

/* ============================================
   Dark Mode Toggle Button
   ============================================ */
.theme-toggle {
    position: relative;
    width: 44px;
    height: 24px;
    background: var(--border);
    border-radius: var(--radius-full);
    border: none;
    cursor: pointer;
    transition: background 0.3s ease;
    overflow: hidden;
}

.theme-toggle::before {
    content: '';
    position: absolute;
    top: 2px;
    left: 2px;
    width: 20px;
    height: 20px;
    background: white;
    border-radius: 50%;
    transition: transform 0.3s ease;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.theme-toggle .sun-icon,
.theme-toggle .moon-icon {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 14px;
    height: 14px;
    transition: opacity 0.3s ease;
}

.theme-toggle .sun-icon {
    left: 5px;
    opacity: 1;
}

.theme-toggle .moon-icon {
    right: 5px;
    opacity: 0.5;
}

[data-theme="dark"] .theme-toggle {
    background: var(--primary);
}

[data-theme="dark"] .theme-toggle::before {
    transform: translateX(20px);
}

[data-theme="dark"] .theme-toggle .sun-icon {
    opacity: 0.5;
}

[data-theme="dark"] .theme-toggle .moon-icon {
    opacity: 1;
}

/* ============================================
   Animated Counter
   ============================================ */
.counter {
    display: inline-block;
}

.counter.counting {
    animation: counter-pulse 0.1s ease;
}

@keyframes counter-pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.02); }
}

/* ============================================
   Trend Indicators
   ============================================ */
.trend {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 0.8rem;
    font-weight: 500;
    padding: 4px 10px;
    border-radius: var(--radius-full);
}

.trend.up {
    background: rgba(16, 185, 129, 0.1);
    color: var(--success);
}

.trend.down {
    background: rgba(239, 68, 68, 0.1);
    color: var(--danger);
}

.trend.neutral {
    background: rgba(100, 116, 139, 0.1);
    color: var(--text-light);
}

.trend-icon {
    width: 16px;
    height: 16px;
}

/* ============================================
   Form Validation States
   ============================================ */
.form-group {
    position: relative;
}

.form-group input.error,
.form-group select.error,
.form-group textarea.error {
    border-color: var(--danger);
    background: rgba(239, 68, 68, 0.05);
}

.form-group input.success,
.form-group select.success,
.form-group textarea.success {
    border-color: var(--success);
}

.form-error {
    display: none;
    font-size: 0.75rem;
    color: var(--danger);
    margin-top: 0.25rem;
}

.form-group.has-error .form-error {
    display: block;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(var(--primary-rgb), 0.1);
}

/* ============================================
   Keyboard Shortcut Hints
   ============================================ */
.kbd {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 24px;
    height: 24px;
    padding: 0 6px;
    font-family: inherit;
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--text-light);
    background: var(--bg-light);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    box-shadow: 0 1px 0 var(--border);
}

/* ============================================
   Breadcrumb Navigation
   ============================================ */
.breadcrumb {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    color: var(--text-light);
    margin-bottom: 1rem;
}

.breadcrumb-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.breadcrumb-item a {
    color: var(--text-light);
    text-decoration: none;
    transition: color 0.2s;
}

.breadcrumb-item a:hover {
    color: var(--primary);
}

.breadcrumb-item.active {
    color: var(--text-dark);
    font-weight: 500;
}

.breadcrumb-separator {
    color: var(--text-muted);
}

/* ============================================
   Search Input
   ============================================ */
.search-input {
    position: relative;
}

.search-input input {
    width: 100%;
    padding: 0.75rem 1rem 0.75rem 2.75rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    font-size: 0.875rem;
    transition: all 0.2s;
}

.search-input input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(var(--primary-rgb), 0.1);
}

.search-input .search-icon {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    width: 18px;
    height: 18px;
}

.search-input .search-clear {
    position: absolute;
    right: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 0.25rem;
    opacity: 0;
    transition: opacity 0.2s;
}

.search-input input:not(:placeholder-shown) ~ .search-clear {
    opacity: 1;
}

/* ============================================
   Checkbox & Bulk Selection
   ============================================ */
.checkbox-wrapper {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.custom-checkbox {
    position: relative;
    width: 20px;
    height: 20px;
}

.custom-checkbox input {
    position: absolute;
    opacity: 0;
    cursor: pointer;
    width: 100%;
    height: 100%;
    margin: 0;
    z-index: 1;
}

.custom-checkbox .checkmark {
    position: absolute;
    top: 0;
    left: 0;
    width: 20px;
    height: 20px;
    background: var(--card-bg);
    border: 2px solid var(--border);
    border-radius: var(--radius-sm);
    transition: all 0.2s;
}

.custom-checkbox input:checked ~ .checkmark {
    background: var(--primary);
    border-color: var(--primary);
}

.custom-checkbox .checkmark::after {
    content: '';
    position: absolute;
    display: none;
    left: 6px;
    top: 2px;
    width: 5px;
    height: 10px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

.custom-checkbox input:checked ~ .checkmark::after {
    display: block;
}

/* Bulk Action Bar */
.bulk-action-bar {
    display: none;
    align-items: center;
    gap: 1rem;
    padding: 0.75rem 1rem;
    background: var(--primary);
    color: white;
    border-radius: var(--radius-md);
    margin-bottom: 1rem;
}

.bulk-action-bar.active {
    display: flex;
}

.bulk-action-bar .selected-count {
    font-weight: 600;
}

.bulk-action-bar .bulk-actions {
    display: flex;
    gap: 0.5rem;
    margin-left: auto;
}

.bulk-action-bar .bulk-btn {
    padding: 0.5rem 1rem;
    background: rgba(255,255,255,0.2);
    border: none;
    border-radius: var(--radius-sm);
    color: white;
    cursor: pointer;
    font-size: 0.875rem;
    transition: background 0.2s;
}

.bulk-action-bar .bulk-btn:hover {
    background: rgba(255,255,255,0.3);
}

.bulk-action-bar .bulk-btn.danger:hover {
    background: var(--danger);
}

/* ============================================
   Collapsible Sidebar
   ============================================ */
.sidebar.collapsed {
    width: var(--sidebar-collapsed-width);
}

.sidebar.collapsed .sidebar-logo h2,
.sidebar.collapsed .sidebar-logo span,
.sidebar.collapsed .menu-item span,
.sidebar.collapsed .user-info > div:last-child,
.sidebar.collapsed .logout-btn span {
    display: none;
}

.sidebar.collapsed .menu-item {
    justify-content: center;
    padding: 0.875rem;
}

.sidebar.collapsed .menu-item svg {
    margin: 0;
}

.sidebar-toggle {
    position: absolute;
    top: 1rem;
    right: -12px;
    width: 24px;
    height: 24px;
    background: var(--primary);
    border: 2px solid var(--bg-light);
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    transition: transform 0.3s;
    z-index: 10;
}

.sidebar.collapsed .sidebar-toggle {
    transform: rotate(180deg);
}

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

/* ============================================
   Mobile Responsive Enhancements
   ============================================ */
@media (max-width: 768px) {
    .toast-container {
        left: 1rem;
        right: 1rem;
        max-width: none;
    }

    .bulk-action-bar {
        flex-wrap: wrap;
    }

    .bulk-action-bar .bulk-actions {
        width: 100%;
        margin-left: 0;
        margin-top: 0.5rem;
    }
}

/* ============================================
   Print Styles
   ============================================ */
@media print {
    .toast-container,
    .theme-toggle,
    .sidebar-toggle,
    .bulk-action-bar {
        display: none !important;
    }
}
