/* ============================================================
   IT Helpdesk - Ana Stil Dosyası
   Premium tasarım: Glassmorphism, Gradient, Animasyonlar
   ============================================================ */

/* ---- Google Fonts ---- */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap');

/* ---- CSS Değişkenleri ---- */
:root {
    --primary: #4F46E5;
    --primary-dark: #4338CA;
    --primary-light: #818CF8;
    --secondary: #0EA5E9;
    --secondary-dark: #0284C7;
    --accent: #7C3AED;
    --success: #10B981;
    --warning: #F59E0B;
    --danger: #EF4444;
    --info: #06B6D4;
    
    --bg-primary: #f0f2f5;
    --bg-card: #ffffff;
    --bg-sidebar: linear-gradient(180deg, #1e1b4b 0%, #312e81 50%, #1e1b4b 100%);
    
    --text-primary: #1f2937;
    --text-secondary: #6b7280;
    --text-muted: #9ca3af;
    --text-white: #ffffff;
    
    --border-color: #e5e7eb;
    --border-radius: 12px;
    --border-radius-sm: 8px;
    --border-radius-lg: 16px;
    
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.08);
    --shadow-md: 0 4px 12px rgba(0,0,0,0.1);
    --shadow-lg: 0 10px 25px rgba(0,0,0,0.12);
    --shadow-xl: 0 20px 40px rgba(0,0,0,0.15);
    
    --sidebar-width: 280px;
    --sidebar-collapsed: 70px;
    --navbar-height: 65px;
    
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-fast: all 0.15s ease;
}

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    font-size: 14px;
    color: var(--text-primary);
    background-color: var(--bg-primary);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

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

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

/* ---- Sidebar ---- */
.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: var(--sidebar-width);
    height: 100vh;
    background: var(--bg-sidebar);
    z-index: 1000;
    transition: var(--transition);
    overflow-y: auto;
    overflow-x: hidden;
    scrollbar-width: thin;
    scrollbar-color: rgba(255,255,255,0.1) transparent;
}

.sidebar::-webkit-scrollbar {
    width: 4px;
}

.sidebar::-webkit-scrollbar-thumb {
    background: rgba(255,255,255,0.15);
    border-radius: 4px;
}

.sidebar-brand {
    display: flex;
    align-items: center;
    padding: 20px 24px;
    border-bottom: 1px solid rgba(255,255,255,0.08);
    min-height: var(--navbar-height);
}

.sidebar-brand img {
    height: 36px;
    margin-right: 12px;
}

.sidebar-brand .brand-text {
    color: var(--text-white);
    font-size: 18px;
    font-weight: 700;
    letter-spacing: -0.5px;
}

.sidebar-menu {
    padding: 16px 12px;
    list-style: none;
}

.sidebar-menu .menu-label {
    color: rgba(255,255,255,0.4);
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1.2px;
    padding: 16px 16px 8px;
    margin-top: 8px;
}

.sidebar-menu .menu-item {
    margin-bottom: 2px;
}

.sidebar-menu .menu-link {
    display: flex;
    align-items: center;
    padding: 11px 16px;
    color: rgba(255,255,255,0.65);
    border-radius: var(--border-radius-sm);
    transition: var(--transition);
    font-size: 13.5px;
    font-weight: 500;
    position: relative;
    overflow: hidden;
}

.sidebar-menu .menu-link::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    height: 100%;
    width: 3px;
    background: var(--primary-light);
    border-radius: 0 4px 4px 0;
    transform: scaleY(0);
    transition: var(--transition);
}

.sidebar-menu .menu-link:hover {
    color: var(--text-white);
    background: rgba(255,255,255,0.08);
}

.sidebar-menu .menu-link.active {
    color: var(--text-white);
    background: rgba(79, 70, 229, 0.25);
}

.sidebar-menu .menu-link.active::before {
    transform: scaleY(1);
}

.sidebar-menu .menu-link i {
    font-size: 18px;
    width: 24px;
    margin-right: 12px;
    text-align: center;
    flex-shrink: 0;
}

.sidebar-menu .menu-badge {
    margin-left: auto;
    background: var(--danger);
    color: white;
    font-size: 11px;
    padding: 2px 8px;
    border-radius: 20px;
    font-weight: 600;
    min-width: 22px;
    text-align: center;
}

/* ---- Main Content ---- */
.main-content {
    margin-left: var(--sidebar-width);
    min-height: 100vh;
    transition: var(--transition);
}

/* ---- Top Navbar ---- */
.top-navbar {
    height: var(--navbar-height);
    background: var(--bg-card);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 28px;
    position: sticky;
    top: 0;
    z-index: 999;
    box-shadow: var(--shadow-sm);
}

.top-navbar .navbar-left {
    display: flex;
    align-items: center;
    gap: 16px;
}

.top-navbar .navbar-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

.sidebar-toggle {
    display: none;
    border: none;
    background: none;
    font-size: 22px;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 4px;
}

.search-box {
    position: relative;
}

.search-box input {
    width: 320px;
    padding: 9px 16px 9px 42px;
    border: 1px solid var(--border-color);
    border-radius: 50px;
    font-size: 13px;
    background: var(--bg-primary);
    transition: var(--transition);
    font-family: 'Inter', sans-serif;
}

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

.search-box i {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    font-size: 15px;
}

/* Notification Bell */
.nav-notification {
    position: relative;
    cursor: pointer;
    padding: 8px;
    border-radius: 50%;
    transition: var(--transition);
}

.nav-notification:hover {
    background: var(--bg-primary);
}

.nav-notification i {
    font-size: 20px;
    color: var(--text-secondary);
}

.nav-notification .badge-count {
    position: absolute;
    top: 2px;
    right: 2px;
    background: var(--danger);
    color: white;
    font-size: 10px;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    border: 2px solid var(--bg-card);
}

/* User Dropdown */
.nav-user {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 6px 12px 6px 6px;
    border-radius: 50px;
    cursor: pointer;
    transition: var(--transition);
    border: 1px solid transparent;
}

.nav-user:hover {
    background: var(--bg-primary);
    border-color: var(--border-color);
}

.nav-user .avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--primary-light);
}

.nav-user .user-info {
    line-height: 1.3;
}

.nav-user .user-name {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
}

.nav-user .user-role {
    font-size: 11px;
    color: var(--text-muted);
}

/* ---- Page Content ---- */
.page-content {
    padding: 28px;
}

.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 28px;
    flex-wrap: wrap;
    gap: 16px;
}

.page-header h1 {
    font-size: 24px;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: -0.5px;
}

.breadcrumb-nav {
    font-size: 13px;
    color: var(--text-muted);
}

.breadcrumb-nav a {
    color: var(--text-secondary);
}

.breadcrumb-nav .separator {
    margin: 0 8px;
    color: var(--text-muted);
}

/* ---- Cards ---- */
.card {
    background: var(--bg-card);
    border-radius: var(--border-radius);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
    overflow: hidden;
}

.card:hover {
    box-shadow: var(--shadow-md);
}

.card-header {
    padding: 18px 24px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: transparent;
}

.card-header h5 {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
}

.card-body {
    padding: 24px;
}

/* ---- Stat Cards ---- */
.stat-card {
    background: var(--bg-card);
    border-radius: var(--border-radius);
    padding: 24px;
    border: 1px solid var(--border-color);
    position: relative;
    overflow: hidden;
    transition: var(--transition);
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    border-radius: var(--border-radius) var(--border-radius) 0 0;
}

.stat-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-lg);
}

.stat-card .stat-icon {
    width: 52px;
    height: 52px;
    border-radius: var(--border-radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    color: white;
    margin-bottom: 16px;
}

.stat-card .stat-value {
    font-size: 28px;
    font-weight: 800;
    color: var(--text-primary);
    letter-spacing: -1px;
    line-height: 1.2;
}

.stat-card .stat-label {
    font-size: 13px;
    color: var(--text-secondary);
    margin-top: 4px;
    font-weight: 500;
}

.stat-card.primary::before { background: linear-gradient(90deg, var(--primary), var(--accent)); }
.stat-card.primary .stat-icon { background: linear-gradient(135deg, var(--primary), var(--accent)); }

.stat-card.success::before { background: linear-gradient(90deg, var(--success), #34D399); }
.stat-card.success .stat-icon { background: linear-gradient(135deg, var(--success), #34D399); }

.stat-card.warning::before { background: linear-gradient(90deg, var(--warning), #FBBF24); }
.stat-card.warning .stat-icon { background: linear-gradient(135deg, var(--warning), #FBBF24); }

.stat-card.danger::before { background: linear-gradient(90deg, var(--danger), #F87171); }
.stat-card.danger .stat-icon { background: linear-gradient(135deg, var(--danger), #F87171); }

.stat-card.info::before { background: linear-gradient(90deg, var(--info), var(--secondary)); }
.stat-card.info .stat-icon { background: linear-gradient(135deg, var(--info), var(--secondary)); }

.stat-card.secondary::before { background: linear-gradient(90deg, #6B7280, #9CA3AF); }
.stat-card.secondary .stat-icon { background: linear-gradient(135deg, #6B7280, #9CA3AF); }

/* ---- Tables ---- */
.table {
    font-size: 13.5px;
}

.table thead th {
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    font-size: 11.5px;
    letter-spacing: 0.5px;
    border-bottom: 2px solid var(--border-color);
    padding: 14px 16px;
    white-space: nowrap;
}

.table tbody td {
    padding: 14px 16px;
    vertical-align: middle;
    border-bottom: 1px solid #f3f4f6;
}

.table tbody tr {
    transition: var(--transition-fast);
}

.table tbody tr:hover {
    background: #f9fafb;
}

/* ---- Badges ---- */
.badge {
    font-size: 11.5px;
    font-weight: 600;
    padding: 4px 10px;
    border-radius: 20px;
    letter-spacing: 0.3px;
}

/* ---- Buttons ---- */
.btn {
    font-family: 'Inter', sans-serif;
    font-weight: 600;
    font-size: 13.5px;
    padding: 9px 20px;
    border-radius: var(--border-radius-sm);
    transition: var(--transition);
    letter-spacing: 0.2px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.btn:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary), var(--accent));
    border: none;
    color: white;
}

.btn-primary:hover {
    background: linear-gradient(135deg, var(--primary-dark), #6D28D9);
    color: white;
}

.btn-success {
    background: linear-gradient(135deg, var(--success), #34D399);
    border: none;
    color: white;
}

.btn-danger {
    background: linear-gradient(135deg, var(--danger), #F87171);
    border: none;
    color: white;
}

.btn-outline-primary {
    border: 1.5px solid var(--primary);
    color: var(--primary);
    background: transparent;
}

.btn-outline-primary:hover {
    background: var(--primary);
    color: white;
}

.btn-light {
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
}

.btn-sm {
    padding: 6px 14px;
    font-size: 12.5px;
}

/* ---- Forms ---- */
.form-control, .form-select {
    font-family: 'Inter', sans-serif;
    font-size: 13.5px;
    padding: 10px 16px;
    border: 1.5px solid var(--border-color);
    border-radius: var(--border-radius-sm);
    transition: var(--transition);
    color: var(--text-primary);
}

.form-control:focus, .form-select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(79,70,229,0.12);
    outline: none;
}

.form-label {
    font-weight: 600;
    font-size: 13px;
    color: var(--text-primary);
    margin-bottom: 6px;
}

.form-text {
    font-size: 12px;
    color: var(--text-muted);
}

textarea.form-control {
    min-height: 120px;
    resize: vertical;
}

/* ---- Alerts ---- */
.alert {
    border: none;
    border-radius: var(--border-radius-sm);
    padding: 14px 20px;
    font-size: 13.5px;
    font-weight: 500;
}

.alert-success {
    background: #ecfdf5;
    color: #065f46;
    border-left: 4px solid var(--success);
}

.alert-danger {
    background: #fef2f2;
    color: #991b1b;
    border-left: 4px solid var(--danger);
}

.alert-warning {
    background: #fffbeb;
    color: #92400e;
    border-left: 4px solid var(--warning);
}

.alert-info {
    background: #eff6ff;
    color: #1e40af;
    border-left: 4px solid var(--info);
}

/* ---- Pagination ---- */
.pagination .page-item .page-link {
    font-size: 13px;
    font-weight: 500;
    padding: 8px 14px;
    border-radius: var(--border-radius-sm);
    margin: 0 3px;
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    transition: var(--transition);
}

.pagination .page-item.active .page-link {
    background: var(--primary);
    border-color: var(--primary);
    color: white;
}

.pagination .page-item .page-link:hover {
    background: var(--bg-primary);
    border-color: var(--primary);
    color: var(--primary);
}

/* ---- Chat ---- */
.chat-container {
    height: 500px;
    display: flex;
    flex-direction: column;
}

.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    background: #f9fafb;
    border-radius: var(--border-radius-sm);
}

.chat-message {
    display: flex;
    margin-bottom: 16px;
    animation: slideIn 0.3s ease;
}

.chat-message.sent {
    justify-content: flex-end;
}

.chat-bubble {
    max-width: 70%;
    padding: 12px 18px;
    border-radius: 18px;
    font-size: 13.5px;
    line-height: 1.5;
    position: relative;
}

.chat-message.received .chat-bubble {
    background: white;
    border: 1px solid var(--border-color);
    border-bottom-left-radius: 4px;
}

.chat-message.sent .chat-bubble {
    background: linear-gradient(135deg, var(--primary), var(--accent));
    color: white;
    border-bottom-right-radius: 4px;
}

.chat-bubble .chat-time {
    font-size: 10.5px;
    opacity: 0.65;
    margin-top: 6px;
    display: block;
}

.chat-bubble .chat-sender {
    font-size: 11px;
    font-weight: 600;
    opacity: 0.8;
    margin-bottom: 4px;
    display: block;
}

.chat-input-area {
    display: flex;
    gap: 12px;
    padding: 16px;
    border-top: 1px solid var(--border-color);
    background: white;
    border-radius: 0 0 var(--border-radius) var(--border-radius);
}

.chat-input-area input {
    flex: 1;
}

.typing-indicator {
    padding: 8px 16px;
    font-size: 12px;
    color: var(--text-muted);
    font-style: italic;
    display: none;
}

.typing-indicator.show {
    display: block;
}

/* ---- Ticket Detail ---- */
.ticket-info-card {
    background: linear-gradient(135deg, #f8fafc, #eef2ff);
    border: 1px solid #e0e7ff;
    border-radius: var(--border-radius);
    padding: 24px;
}

.ticket-info-card .info-row {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px solid rgba(0,0,0,0.05);
}

.ticket-info-card .info-row:last-child {
    border-bottom: none;
}

.ticket-info-card .info-label {
    font-weight: 600;
    color: var(--text-secondary);
    font-size: 13px;
}

.ticket-info-card .info-value {
    font-weight: 500;
    color: var(--text-primary);
    font-size: 13px;
}

.message-thread {
    position: relative;
    padding-left: 24px;
}

.message-thread::before {
    content: '';
    position: absolute;
    left: 16px;
    top: 0;
    bottom: 0;
    width: 2px;
    background: var(--border-color);
}

.thread-message {
    position: relative;
    margin-bottom: 24px;
    padding-left: 24px;
}

.thread-message::before {
    content: '';
    position: absolute;
    left: -16px;
    top: 18px;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    border: 2px solid var(--primary);
    background: white;
}

.thread-message.admin-reply::before {
    border-color: var(--success);
    background: var(--success);
}

.thread-message .msg-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
}

.thread-message .msg-author {
    font-weight: 600;
    font-size: 14px;
}

.thread-message .msg-time {
    font-size: 12px;
    color: var(--text-muted);
}

.thread-message .msg-body {
    background: white;
    padding: 16px 20px;
    border-radius: var(--border-radius-sm);
    border: 1px solid var(--border-color);
    font-size: 13.5px;
    line-height: 1.7;
}

.thread-message.admin-reply .msg-body {
    background: #f0fdf4;
    border-color: #bbf7d0;
}

/* ---- Notification Dropdown ---- */
.notification-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    width: 360px;
    background: white;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-xl);
    border: 1px solid var(--border-color);
    z-index: 1001;
    display: none;
    max-height: 400px;
    overflow-y: auto;
}

.notification-dropdown.show {
    display: block;
    animation: fadeInDown 0.2s ease;
}

.notification-dropdown .notif-item {
    display: flex;
    gap: 12px;
    padding: 14px 18px;
    border-bottom: 1px solid #f3f4f6;
    transition: var(--transition-fast);
    cursor: pointer;
}

.notification-dropdown .notif-item:hover {
    background: #f9fafb;
}

.notification-dropdown .notif-item.unread {
    background: #eff6ff;
}

.notification-dropdown .notif-icon {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 16px;
}

.notification-dropdown .notif-title {
    font-weight: 600;
    font-size: 13px;
    color: var(--text-primary);
}

.notification-dropdown .notif-text {
    font-size: 12px;
    color: var(--text-secondary);
    margin-top: 2px;
}

.notification-dropdown .notif-time {
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 4px;
}

/* ---- Animations ---- */
@keyframes fadeInDown {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes slideIn {
    from { opacity: 0; transform: translateX(-20px); }
    to { opacity: 1; transform: translateX(0); }
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

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

.fade-in {
    animation: fadeInDown 0.4s ease;
}

/* ---- Toast Notification ---- */
.toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 9999;
}

.toast {
    margin-bottom: 10px;
    border: none;
    border-radius: var(--border-radius-sm);
    box-shadow: var(--shadow-lg);
    animation: fadeInDown 0.3s ease;
}

/* ---- Loading Spinner ---- */
.spinner {
    width: 20px;
    height: 20px;
    border: 2px solid var(--border-color);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}

/* ---- Empty State ---- */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-muted);
}

.empty-state i {
    font-size: 56px;
    margin-bottom: 16px;
    opacity: 0.3;
}

.empty-state h5 {
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.empty-state p {
    font-size: 14px;
    max-width: 360px;
    margin: 0 auto;
}

/* ---- Responsive ---- */
@media (max-width: 991px) {
    .sidebar {
        transform: translateX(-100%);
    }

    .sidebar.show {
        transform: translateX(0);
    }

    .main-content {
        margin-left: 0;
    }

    .sidebar-toggle {
        display: block;
    }

    .search-box input {
        width: 200px;
    }

    .search-box input:focus {
        width: 240px;
    }

    .sidebar-overlay {
        display: none;
        position: fixed;
        inset: 0;
        background: rgba(0,0,0,0.5);
        z-index: 999;
    }

    .sidebar-overlay.show {
        display: block;
    }
}

@media (max-width: 767px) {
    .page-content {
        padding: 16px;
    }

    .page-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .search-box {
        display: none;
    }

    .stat-card .stat-value {
        font-size: 22px;
    }

    .nav-user .user-info {
        display: none;
    }

    .notification-dropdown {
        width: 300px;
        right: -50px;
    }

    .chat-bubble {
        max-width: 85%;
    }
}

@media (max-width: 575px) {
    .top-navbar {
        padding: 0 16px;
    }

    .page-content {
        padding: 12px;
    }

    .card-body {
        padding: 16px;
    }

    .table-responsive {
        font-size: 12px;
    }
}
