/* 
 * Kırşehir Bil Koleji - İzin Yönetim Sistemi
 * Modern Glassmorphic Design System - 2026 Vision
 */

/* ==================== Google Fonts ==================== */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap');

/* ==================== CSS Variables ==================== */
:root {
    /* Colors - Modern Gradients */
    --primary-gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --accent-gradient: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    --success-color: #4ade80;
    --warning-color: #fbbf24;
    --error-color: #ef4444;
    --info-color: #3b82f6;

    /* Backgrounds - Dark Mode */
    --bg-dark: #0f172a;
    --bg-darker: #020617;
    --bg-card: rgba(30, 41, 59, 0.7);
    --bg-card-hover: rgba(51, 65, 85, 0.8);

    /* Text Colors - Dark Mode */
    --text-primary: #f8fafc;
    --text-secondary: #cbd5e1;
    --text-muted: #94a3b8;

    /* Glass Effect */
    --glass-bg: rgba(255, 255, 255, 0.05);
    --glass-border: rgba(255, 255, 255, 0.1);
    --glass-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.37);

    /* Shadows */
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.1);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.2);
    --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.3);
    --shadow-glow: 0 0 20px rgba(102, 126, 234, 0.4);

    /* Border Radius */
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 24px;

    /* Spacing */
    --spacing-xs: 0.5rem;
    --spacing-sm: 1rem;
    --spacing-md: 1.5rem;
    --spacing-lg: 2rem;
    --spacing-xl: 3rem;

    /* Transitions - Optimized */
    --transition-fast: 0.15s ease-out;
    --transition-normal: 0.2s ease-out;
    --transition-slow: 0.3s ease-out;
}

/* Light Mode */
body.light-mode {
    --bg-dark: #f1f5f9;
    --bg-darker: #e2e8f0;
    --bg-card: rgba(255, 255, 255, 0.9);
    --bg-card-hover: rgba(248, 250, 252, 0.95);

    --text-primary: #0f172a;
    --text-secondary: #475569;
    --text-muted: #64748b;

    --glass-bg: rgba(255, 255, 255, 0.7);
    --glass-border: rgba(15, 23, 42, 0.15);
    --glass-shadow: 0 8px 32px 0 rgba(100, 116, 139, 0.12);

    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.06);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.08);
    --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.1);
}

body.light-mode::before {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 50%, #f093fb 100%);
    opacity: 0.04;
}

body.light-mode::after {
    background-image:
        radial-gradient(circle at 20% 50%, rgba(102, 126, 234, 0.08) 0%, transparent 50%),
        radial-gradient(circle at 80% 80%, rgba(240, 147, 251, 0.08) 0%, transparent 50%),
        radial-gradient(circle at 40% 20%, rgba(118, 75, 162, 0.08) 0%, transparent 50%);
}

/* Theme Switcher - Beautiful Toggle */
.theme-switcher {
    display: flex;
    align-items: center;
    margin-right: 1rem;
}

.theme-toggle {
    width: 70px;
    height: 36px;
    background: var(--glass-bg);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 2px solid var(--glass-border);
    border-radius: 50px;
    padding: 3px;
    cursor: pointer;
    position: relative;
    transition: border-color var(--transition-fast);
    box-shadow: var(--shadow-sm);
    display: flex;
    align-items: center;
    justify-content: space-between;
    will-change: border-color;
}

.theme-toggle:hover {
    border-color: rgba(102, 126, 234, 0.5);
}

.theme-toggle-slider {
    position: absolute;
    width: 28px;
    height: 28px;
    background: var(--primary-gradient);
    border-radius: 50%;
    transition: all var(--transition-normal);
    left: 3px;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
}

body.light-mode .theme-toggle-slider {
    left: calc(100% - 31px);
    background: linear-gradient(135deg, #fbbf24 0%, #f59e0b 100%);
    box-shadow: 0 2px 8px rgba(251, 191, 36, 0.5);
}

.theme-icon {
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
    z-index: 1;
    opacity: 0.5;
    transition: opacity var(--transition-fast);
    padding: 0 8px;
}

.theme-icon.active {
    opacity: 1;
}

.theme-icon-moon {
    filter: brightness(1.2);
}

body.light-mode .theme-icon-sun {
    opacity: 1;
}

body.light-mode .theme-icon-moon {
    opacity: 0.4;
}

/* ==================== Reset & Base Styles ==================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg-dark);
    color: var(--text-primary);
    line-height: 1.6;
    overflow-x: hidden;
    min-height: 100vh;
}

/* Animated Background - Optimized (static) */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 50%, #f093fb 100%);
    opacity: 0.05;
    z-index: -2;
    pointer-events: none;
}

/* Floating Particles Background - Simplified */
body::after {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image:
        radial-gradient(circle at 20% 50%, rgba(102, 126, 234, 0.1) 0%, transparent 40%),
        radial-gradient(circle at 80% 80%, rgba(240, 147, 251, 0.1) 0%, transparent 40%);
    z-index: -1;
    pointer-events: none;
}

/* ==================== Utility Classes ==================== */
.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 var(--spacing-md);
}

.text-center {
    text-align: center;
}

.text-gradient {
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* ==================== Glass Cards - Optimized ==================== */
.glass-card {
    background: var(--glass-bg);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-lg);
    padding: var(--spacing-lg);
    box-shadow: var(--shadow-sm);
    transition: transform var(--transition-fast), box-shadow var(--transition-fast);
    will-change: transform;
}

.glass-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.glass-card-header {
    margin-bottom: var(--spacing-md);
    padding-bottom: var(--spacing-md);
    border-bottom: 1px solid var(--glass-border);
}

.glass-card-header h2 {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.glass-card-header p {
    color: var(--text-muted);
    font-size: 0.9rem;
}

/* ==================== Buttons ==================== */
.btn {
    padding: 0.75rem 1.5rem;
    border-radius: var(--radius-md);
    font-weight: 600;
    font-size: 0.95rem;
    border: none;
    cursor: pointer;
    transition: all var(--transition-fast);
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    position: relative;
    overflow: hidden;
}

.btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.15);
    transform: translate(-50%, -50%);
    transition: width 0.3s, height 0.3s;
}

.btn:hover::before {
    width: 200px;
    height: 200px;
}

.btn-primary {
    background: var(--primary-gradient);
    color: white;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.6);
}

.btn-success {
    background: linear-gradient(135deg, #4ade80 0%, #10b981 100%);
    color: white;
    box-shadow: 0 4px 15px rgba(74, 222, 128, 0.4);
}

.btn-danger {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    color: white;
    box-shadow: 0 4px 15px rgba(239, 68, 68, 0.4);
}

.btn-outline {
    background: transparent;
    border: 2px solid var(--glass-border);
    color: var(--text-primary);
}

.btn-outline:hover {
    background: var(--glass-bg);
    border-color: rgba(102, 126, 234, 0.5);
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* ==================== Forms ==================== */
.form-group {
    margin-bottom: var(--spacing-md);
}

.form-label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.form-input,
.form-select,
.form-textarea {
    width: 100%;
    padding: 0.875rem 1rem;
    background: rgba(15, 23, 42, 0.6);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: 0.95rem;
    transition: all var(--transition-fast);
    font-family: inherit;
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
    outline: none;
    border-color: rgba(102, 126, 234, 0.6);
    background: rgba(15, 23, 42, 0.8);
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.form-textarea {
    resize: vertical;
    min-height: 100px;
}

.form-input::placeholder,
.form-textarea::placeholder {
    color: var(--text-muted);
}

/* Light Mode Form Fixes */
body.light-mode .form-input,
body.light-mode .form-select,
body.light-mode .form-textarea {
    background: rgba(255, 255, 255, 0.8);
    border: 1px solid rgba(15, 23, 42, 0.2);
}

body.light-mode .form-input:focus,
body.light-mode .form-select:focus,
body.light-mode .form-textarea:focus {
    background: rgba(255, 255, 255, 0.95);
    border-color: rgba(102, 126, 234, 0.6);
}

body.light-mode .file-upload-area {
    background: rgba(255, 255, 255, 0.6);
    border-color: rgba(15, 23, 42, 0.2);
}

body.light-mode .file-upload-area:hover {
    background: rgba(102, 126, 234, 0.08);
}

/* ==================== Stats Cards ==================== */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: var(--spacing-md);
    margin-bottom: var(--spacing-lg);
}

.stat-card {
    background: var(--glass-bg);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-lg);
    padding: var(--spacing-md);
    position: relative;
    overflow: hidden;
    transition: transform var(--transition-fast);
    will-change: transform;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: var(--primary-gradient);
}

.stat-card:hover {
    transform: translateY(-2px);
}

.stat-icon {
    width: 50px;
    height: 50px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    margin-bottom: var(--spacing-sm);
    background: var(--primary-gradient);
}

.stat-value {
    font-size: 2rem;
    font-weight: 800;
    margin-bottom: 0.25rem;
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.stat-label {
    color: var(--text-secondary);
    font-size: 0.9rem;
    font-weight: 500;
}

/* ==================== Table ==================== */
.table-container {
    overflow-x: auto;
    border-radius: var(--radius-lg);
    background: var(--glass-bg);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid var(--glass-border);
}

.table {
    width: 100%;
    border-collapse: collapse;
}

.table thead {
    background: rgba(102, 126, 234, 0.1);
}

.table th {
    padding: 1rem;
    text-align: left;
    font-weight: 600;
    color: var(--text-secondary);
    border-bottom: 1px solid var(--glass-border);
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.table td {
    padding: 1rem;
    border-bottom: 1px solid var(--glass-border);
    color: var(--text-primary);
}

.table tbody tr {
    transition: all var(--transition-fast);
}

.table tbody tr:hover {
    background: rgba(102, 126, 234, 0.05);
}

/* ==================== Badges ==================== */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 0.375rem 0.75rem;
    border-radius: var(--radius-sm);
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.badge-pending {
    background: linear-gradient(135deg, #fbbf24 0%, #f59e0b 100%);
    color: #000;
}

.badge-approved {
    background: linear-gradient(135deg, #4ade80 0%, #10b981 100%);
    color: #000;
}

.badge-rejected {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    color: white;
}

.badge-teacher {
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    color: white;
}

.badge-staff {
    background: linear-gradient(135deg, #8b5cf6 0%, #7c3aed 100%);
    color: white;
}

/* ==================== Modal ==================== */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: opacity var(--transition-fast), visibility var(--transition-fast);
}

.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.modal {
    background: var(--bg-card);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-lg);
    padding: var(--spacing-lg);
    max-width: 600px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    transform: scale(0.9);
    transition: transform var(--transition-normal);
}

.modal-overlay.active .modal {
    transform: scale(1);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--spacing-md);
    padding-bottom: var(--spacing-md);
    border-bottom: 1px solid var(--glass-border);
}

.modal-header h3 {
    font-size: 1.5rem;
    font-weight: 700;
}

.modal-close {
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 1.5rem;
    cursor: pointer;
    transition: color var(--transition-fast);
}

.modal-close:hover {
    color: var(--error-color);
}

/* ==================== Toast Notifications ==================== */
.toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 2000;
}

.toast {
    background: var(--glass-bg);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid var(--glass-border);
    border-left: 4px solid;
    border-radius: var(--radius-md);
    padding: 1rem 1.5rem;
    margin-bottom: 1rem;
    min-width: 300px;
    box-shadow: var(--shadow-md);
    animation: slideInRight 0.2s ease-out;
}

@keyframes slideInRight {
    from {
        transform: translateX(400px);
        opacity: 0;
    }

    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.toast-success {
    border-left-color: var(--success-color);
}

.toast-error {
    border-left-color: var(--error-color);
}

.toast-warning {
    border-left-color: var(--warning-color);
}

.toast-info {
    border-left-color: var(--info-color);
}

/* ==================== Loading Spinner ==================== */
.loading-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid rgba(102, 126, 234, 0.1);
    border-top-color: #667eea;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin: 2rem auto;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* ==================== File Upload ==================== */
.file-upload-area {
    border: 2px dashed var(--glass-border);
    border-radius: var(--radius-lg);
    padding: var(--spacing-xl);
    text-align: center;
    cursor: pointer;
    transition: all var(--transition-normal);
    background: rgba(15, 23, 42, 0.4);
}

.file-upload-area:hover {
    border-color: rgba(102, 126, 234, 0.6);
    background: rgba(102, 126, 234, 0.05);
}

.file-upload-area.dragover {
    border-color: #667eea;
    background: rgba(102, 126, 234, 0.1);
}

.file-upload-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
    color: var(--text-muted);
}

/* ==================== Navbar ==================== */
.navbar {
    background: var(--glass-bg);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--glass-border);
    padding: 1rem 0;
    position: sticky;
    top: 0;
    z-index: 100;
}

.navbar-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.navbar-brand {
    font-size: 1.25rem;
    font-weight: 800;
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.navbar-menu {
    display: flex;
    gap: var(--spacing-md);
    align-items: center;
}

.navbar-user {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--primary-gradient);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
}

/* ==================== Responsive Design ==================== */
@media (max-width: 768px) {
    :root { font-size: 14px; }
    body { padding-bottom: 2rem; }
    .stats-grid { grid-template-columns: 1fr; gap: var(--spacing-sm); }
    .stat-card { padding: var(--spacing-sm); }
    .navbar { padding: 0.75rem 0; }
    .navbar-content { flex-direction: column; gap: 0.75rem; }
    .navbar-menu { width: 100%; justify-content: space-between; flex-wrap: wrap; gap: 0.5rem; }
    .navbar-user { font-size: 0.85rem; }
    .user-avatar { width: 35px; height: 35px; }
    .theme-toggle { width: 60px; height: 32px; }
    .theme-toggle-slider { width: 24px; height: 24px; }
    body.light-mode .theme-toggle-slider { left: calc(100% - 27px); }
    .calendar-controls { margin: 1rem 0; }
    .calendar-month-title { font-size: 1.2rem; }
    .calendar-nav-btn { width: 36px; height: 36px; }
    .calendar-grid { gap: 3px; }
    .calendar-day { min-height: 60px; padding: 0.3rem; }
    .calendar-day-header { padding: 0.5rem; font-size: 0.75rem; }
    .calendar-day-number { font-size: 0.85rem; }
    .calendar-leave-item { font-size: 0.6rem; padding: 2px 3px; }
    .calendar-legend { flex-direction: column; gap: 0.75rem; padding: 0.75rem; }
    .table-container { font-size: 0.8rem; overflow-x: auto; }
    .table { min-width: 600px; }
    .table th, .table td { padding: 0.75rem 0.5rem; font-size: 0.8rem; }
    .action-buttons { flex-direction: column; gap: 0.25rem; }
    .action-buttons .btn { padding: 0.4rem 0.75rem; font-size: 0.8rem; width: 100%; }
    .form-input, .form-select, .form-textarea { padding: 0.75rem; font-size: 16px; }
    .btn { padding: 0.65rem 1.25rem; font-size: 0.9rem; width: 100%; justify-content: center; }
    .glass-card { padding: var(--spacing-sm); }
    .modal { width: 95%; padding: var(--spacing-md); }
    .page-title { font-size: 1.75rem; }
    .toast-container { top: 10px; right: 10px; left: 10px; }
    .toast { min-width: auto; width: 100%; }
}

@media (max-width: 480px) {
    :root { font-size: 13px; }
    .calendar-day { min-height: 50px; padding: 0.25rem; }
    .calendar-day-number { font-size: 0.8rem; }
    .calendar-leave-item { font-size: 0.55rem; }
    .page-title { font-size: 1.5rem; }
    .stat-value { font-size: 1.5rem; }
}

@media (hover: none) and (pointer: coarse) {
    .btn { min-height: 44px; }
    .calendar-nav-btn { min-width: 44px; min-height: 44px; }
    .glass-card:hover, .stat-card:hover, .calendar-day:hover { transform: none; }
}

/* ==================== Animations ==================== */
.fade-in {
    animation: fadeIn 0.5s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

.slide-up {
    animation: slideUp 0.5s ease;
}

@keyframes slideUp {
    from {
        transform: translateY(30px);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* ==================== Scrollbar ==================== */
::-webkit-scrollbar {
    width: 10px;
}

::-webkit-scrollbar-track {
    background: var(--bg-darker);
}

::-webkit-scrollbar-thumb {
    background: var(--primary-gradient);
    border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(135deg, #7c8ff0 0%, #8757ae 100%);
}