/**
 * Onysoft Akıllı İzleme Sistemi - Ana Stil Dosyası
 */

:root {
    --primary: #10B981;
    --primary-dark: #059669;
    --secondary: #6B7280;
    --success: #10B981;
    --danger: #EF4444;
    --warning: #F59E0B;
    --info: #3B82F6;
    --dark: #1F2937;
    --light: #F3F4F6;
    --white: #FFFFFF;

    --sidebar-width: 260px;
    --header-height: 64px;

    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px -1px rgba(0, 0, 0, 0.1);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -4px rgba(0, 0, 0, 0.1);

    --border-radius: 8px;
    --border-radius-lg: 12px;
}

/* Base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background-color: #F1F5F9;
    color: var(--dark);
    line-height: 1.5;
    overflow-x: hidden;
}

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

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

/* Layout */
.wrapper {
    display: flex;
    min-height: 100vh;
    overflow-x: hidden;
    width: 100%;
}

.main-content {
    flex: 1;
    margin-left: var(--sidebar-width);
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    max-width: calc(100% - var(--sidebar-width));
    overflow-x: hidden;
}

.content-area {
    flex: 1;
    overflow-x: hidden;
    max-width: 100%;
    width: 100%;
}

/* Form ve card genişlik düzeltmesi */
.content-area .card,
.content-area .row,
.content-area form {
    max-width: 100%;
}

.content-area .form-control,
.content-area .form-select {
    max-width: 100%;
}

/* Sidebar */
.sidebar {
    width: var(--sidebar-width);
    background: linear-gradient(180deg, #1E293B 0%, #0F172A 100%);
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    overflow-y: auto;
    z-index: 1000;
    transition: transform 0.3s ease;
}

.sidebar-header {
    padding: 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.sidebar-brand {
    display: flex;
    align-items: center;
    color: var(--white);
    font-size: 1.25rem;
    font-weight: 700;
}

.sidebar-brand i {
    font-size: 1.5rem;
    margin-right: 10px;
    color: var(--primary);
}

.sidebar-nav {
    padding: 15px 0;
}

.sidebar-nav .nav-item {
    margin: 2px 10px;
}

.sidebar-nav .nav-link {
    display: flex;
    align-items: center;
    padding: 12px 15px;
    color: rgba(255, 255, 255, 0.7);
    border-radius: var(--border-radius);
    transition: all 0.2s ease;
}

.sidebar-nav .nav-link:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--white);
}

.sidebar-nav .nav-link.active {
    background: var(--primary);
    color: var(--white);
}

.sidebar-nav .nav-link i {
    font-size: 1.2rem;
    margin-right: 12px;
    width: 24px;
    text-align: center;
}

.sidebar-nav .nav-link .bi-chevron-down {
    margin-left: auto;
    margin-right: 0;
    font-size: 0.8rem;
    transition: transform 0.2s ease;
}

.sidebar-nav .nav-link[aria-expanded="true"] .bi-chevron-down {
    transform: rotate(180deg);
}

.sidebar-nav .collapse .nav-link {
    padding: 8px 15px;
    font-size: 0.9rem;
}

.nav-divider {
    height: 1px;
    background: rgba(255, 255, 255, 0.1);
    margin: 15px 20px;
}

.btn-download-agent {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%) !important;
    color: var(--white) !important;
    margin: 10px;
    justify-content: center;
}

.btn-download-agent:hover {
    background: linear-gradient(135deg, var(--primary-dark) 0%, #047857 100%) !important;
}

.sidebar-footer {
    padding: 15px 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    margin-top: auto;
}

.user-info {
    display: flex;
    align-items: center;
}

.user-details {
    margin-left: 12px;
}

.user-name {
    display: block;
    color: var(--white);
    font-weight: 500;
    font-size: 0.9rem;
}

.user-role {
    display: block;
    color: rgba(255, 255, 255, 0.5);
    font-size: 0.8rem;
}

/* Avatar */
.avatar {
    width: 40px;
    height: 40px;
    background: var(--primary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--white);
    font-weight: 600;
    font-size: 1rem;
}

.avatar.small {
    width: 32px;
    height: 32px;
    font-size: 0.85rem;
}

/* Navbar */
.navbar {
    height: var(--header-height);
    box-shadow: var(--shadow-sm);
}

.navbar .btn-link {
    text-decoration: none;
}

/* Notification */
.notification-badge {
    position: absolute;
    top: 0;
    right: 0;
    width: 8px;
    height: 8px;
    background: var(--danger);
    border-radius: 50%;
}

.notification-dropdown {
    max-height: 400px;
    overflow-y: auto;
}

.notification-dropdown .dropdown-header {
    display: flex;
    justify-content: space-between;
    padding: 12px 16px;
    border-bottom: 1px solid var(--light);
}

.notification-list {
    max-height: 300px;
    overflow-y: auto;
}

/* Cards */
.card {
    background: var(--white);
    border: none;
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow);
}

.card-header {
    background: transparent;
    border-bottom: 1px solid var(--light);
    padding: 16px 20px;
}

.card-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--dark);
}

.card-body {
    padding: 20px;
}

/* Stat Cards */
.stat-card {
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

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

.stat-icon {
    width: 56px;
    height: 56px;
    border-radius: var(--border-radius);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    color: var(--white);
}

.stat-icon.bg-primary { background: var(--primary); }
.stat-icon.bg-success { background: var(--success); }
.stat-icon.bg-danger { background: var(--danger); }
.stat-icon.bg-warning { background: var(--warning); }
.stat-icon.bg-info { background: var(--info); }

.stat-label {
    font-size: 0.85rem;
    color: var(--secondary);
    font-weight: 500;
    margin-bottom: 4px;
}

.stat-value {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--dark);
    margin: 0;
}

/* Status Dot */
.status-dot {
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 50%;
}

.status-dot.online {
    background: var(--success);
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.2);
}

.status-dot.offline {
    background: var(--danger);
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.2);
}

/* Badges */
.badge {
    font-weight: 500;
    padding: 5px 10px;
    border-radius: 6px;
}

.badge-success { background: rgba(16, 185, 129, 0.1); color: var(--success); }
.badge-danger { background: rgba(239, 68, 68, 0.1); color: var(--danger); }
.badge-warning { background: rgba(245, 158, 11, 0.1); color: var(--warning); }
.badge-info { background: rgba(59, 130, 246, 0.1); color: var(--info); }
.badge-secondary { background: rgba(107, 114, 128, 0.1); color: var(--secondary); }

/* Tables */
.table {
    margin-bottom: 0;
}

.table th {
    background: #F8FAFC;
    font-weight: 600;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--secondary);
    border-bottom: 2px solid var(--light);
    padding: 12px 16px;
}

.table td {
    padding: 14px 16px;
    vertical-align: middle;
    border-bottom: 1px solid var(--light);
}

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

/* Agent Row Status */
.agent-row-online {
    border-left: 3px solid var(--success);
}

.agent-row-offline {
    border-left: 3px solid var(--danger);
}

.agent-row-critical {
    background: rgba(239, 68, 68, 0.05);
}

/* Progress Bars */
.progress {
    background: var(--light);
    border-radius: 10px;
    overflow: hidden;
}

.progress-bar {
    border-radius: 10px;
    transition: width 0.6s ease;
}

.progress-bar.bg-success { background: var(--success) !important; }
.progress-bar.bg-warning { background: var(--warning) !important; }
.progress-bar.bg-danger { background: var(--danger) !important; }

/* Buttons */
.btn-primary {
    background: var(--primary);
    border-color: var(--primary);
}

.btn-primary:hover {
    background: var(--primary-dark);
    border-color: var(--primary-dark);
}

.btn-outline-primary {
    color: var(--primary);
    border-color: var(--primary);
}

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

/* Forms */
.form-control, .form-select {
    border: 2px solid var(--light);
    border-radius: var(--border-radius);
    padding: 10px 14px;
}

.form-control:focus, .form-select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 0.2rem rgba(16, 185, 129, 0.15);
}

.form-label {
    font-weight: 500;
    color: var(--dark);
    margin-bottom: 6px;
}

/* Filter Bar */
.filter-bar {
    background: var(--white);
    padding: 16px 20px;
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow);
    margin-bottom: 20px;
}

.filter-tabs {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.filter-tab {
    padding: 8px 16px;
    background: var(--light);
    border: none;
    border-radius: var(--border-radius);
    font-size: 0.9rem;
    color: var(--secondary);
    cursor: pointer;
    transition: all 0.2s ease;
}

.filter-tab:hover {
    background: #E5E7EB;
}

.filter-tab.active {
    background: var(--primary);
    color: var(--white);
}

.filter-tab .count {
    background: rgba(0, 0, 0, 0.1);
    padding: 2px 8px;
    border-radius: 10px;
    margin-left: 6px;
    font-size: 0.8rem;
}

.filter-tab.active .count {
    background: rgba(255, 255, 255, 0.2);
}

/* Alerts */
.alert {
    border: none;
    border-radius: var(--border-radius);
}

.alert-success { background: rgba(16, 185, 129, 0.1); color: var(--success); }
.alert-danger { background: rgba(239, 68, 68, 0.1); color: var(--danger); }
.alert-warning { background: rgba(245, 158, 11, 0.1); color: var(--warning); }
.alert-info { background: rgba(59, 130, 246, 0.1); color: var(--info); }

/* Footer */
.footer {
    margin-top: auto;
}

/* Gauge Charts */
.gauge-container {
    text-align: center;
    padding: 20px;
}

.gauge-value {
    font-size: 2rem;
    font-weight: 700;
    margin-top: 10px;
}

.gauge-label {
    color: var(--secondary);
    font-size: 0.9rem;
}

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

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

    .main-content {
        margin-left: 0;
        max-width: 100%;
    }

    /* Filter bar mobil */
    .filter-bar {
        padding: 12px;
    }

    .filter-tabs {
        gap: 4px;
    }

    .filter-tab {
        padding: 6px 10px;
        font-size: 0.8rem;
    }

    /* Stat cards mobil */
    .stat-icon {
        width: 44px;
        height: 44px;
        font-size: 1.2rem;
    }

    .stat-value {
        font-size: 1.25rem;
    }

    .stat-label {
        font-size: 0.75rem;
    }

    /* Card mobil */
    .card-body {
        padding: 15px;
    }

    .card-header {
        padding: 12px 15px;
    }
}

/* Mobil (< 768px) */
@media (max-width: 767.98px) {
    /* Page title mobil */
    h1.h3, .h3 {
        font-size: 1.2rem;
    }

    /* Page header - başlık ve buton */
    .page-header-mobile {
        flex-direction: column;
        gap: 10px;
        align-items: stretch !important;
    }

    .page-header-mobile .btn-group,
    .page-header-mobile .btn {
        width: 100%;
    }

    /* Form row mobil */
    .row.g-3 > [class*="col-md"] {
        margin-bottom: 8px;
    }

    /* Filter tabs horizontal scroll mobil */
    .filter-tabs {
        overflow-x: auto;
        flex-wrap: nowrap;
        -webkit-overflow-scrolling: touch;
        padding-bottom: 5px;
    }

    .filter-tab {
        white-space: nowrap;
        flex-shrink: 0;
    }

    /* Usage bar mobil */
    .usage-bar-inline {
        flex-direction: column;
        align-items: flex-start;
        gap: 4px;
    }

    .usage-bar-inline .progress {
        width: 100%;
    }

    /* Card footer mobil */
    .card-footer .d-flex {
        flex-direction: column;
        gap: 10px;
    }

    /* Modal mobil */
    .modal-dialog {
        margin: 10px;
    }

    /* Table horizontal scroll mobil */
    .table-responsive {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    /* Table mobil - sütunları kompakt yap */
    .table th, .table td {
        padding: 10px 8px;
        font-size: 0.85rem;
    }

    /* Mobil responsive table - satır olarak göster */
    .table-responsive-stack thead {
        display: none;
    }

    .table-responsive-stack tbody tr {
        display: block;
        margin-bottom: 15px;
        border: 1px solid var(--light);
        border-radius: var(--border-radius);
        padding: 10px;
    }

    .table-responsive-stack tbody td {
        display: flex;
        justify-content: space-between;
        padding: 8px 0;
        border: none;
        border-bottom: 1px solid var(--light);
    }

    .table-responsive-stack tbody td:last-child {
        border-bottom: none;
    }

    .table-responsive-stack tbody td::before {
        content: attr(data-label);
        font-weight: 600;
        color: var(--secondary);
        flex: 0 0 40%;
    }

    /* Mobil dropdown menu */
    .dropdown-menu {
        min-width: 200px;
    }

    /* Mobil chart */
    canvas {
        max-width: 100%;
    }

    /* Mobil gauge */
    .gauge-container {
        padding: 10px;
    }

    .gauge-value {
        font-size: 1.5rem;
    }

    /* Mobil alerts */
    .alert {
        font-size: 0.9rem;
        padding: 12px;
    }

    /* Mobil pagination */
    .pagination {
        flex-wrap: wrap;
        justify-content: center;
    }

    .pagination .page-link {
        padding: 6px 10px;
        font-size: 0.85rem;
    }
}

/* Çok küçük ekranlar (< 576px) */
@media (max-width: 575.98px) {
    /* Content area padding ve overflow */
    .content-area {
        padding: 10px !important;
        overflow-x: hidden;
    }

    /* Wrapper ve main-content overflow */
    .wrapper,
    .main-content {
        overflow-x: hidden;
        max-width: 100vw;
    }

    /* Row ve form overflow */
    .row {
        margin-left: 0;
        margin-right: 0;
        max-width: 100%;
    }

    .row > * {
        max-width: 100%;
    }

    /* Row gap */
    .row.g-4 {
        --bs-gutter-x: 0.75rem;
        --bs-gutter-y: 0.75rem;
    }

    .row.g-3 {
        --bs-gutter-x: 0.5rem;
        --bs-gutter-y: 0.5rem;
    }

    .row.g-2 {
        --bs-gutter-x: 0.375rem;
        --bs-gutter-y: 0.375rem;
    }

    /* Stat card kompakt */
    .stat-card .card-body {
        padding: 12px;
    }

    .stat-icon {
        width: 40px;
        height: 40px;
        font-size: 1rem;
    }

    .stat-value {
        font-size: 1.1rem;
    }

    /* Filter bar kompakt */
    .filter-bar {
        padding: 10px;
    }

    /* Button kompakt */
    .btn {
        padding: 8px 12px;
        font-size: 0.9rem;
    }

    .btn-sm {
        padding: 4px 8px;
        font-size: 0.8rem;
    }

    /* Input group kompakt */
    .input-group .form-control,
    .input-group .form-select {
        font-size: 0.9rem;
    }

    /* Card header mobil */
    .card-header.d-flex {
        flex-direction: column;
        gap: 10px;
        align-items: flex-start !important;
    }

    .card-header.d-flex .btn-group,
    .card-header.d-flex .btn {
        width: 100%;
        justify-content: center;
    }

    /* Mobil tablo - checkbox gizle */
    .table th:first-child,
    .table td:first-child {
        width: auto;
    }

    /* Hide less important columns on very small screens */
    .table .d-none-xs {
        display: none !important;
    }
}

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

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

::-webkit-scrollbar-thumb {
    background: #CBD5E1;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #94A3B8;
}

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

.fade-in {
    animation: fadeIn 0.3s ease;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 60px 20px;
}

.empty-state i {
    font-size: 4rem;
    color: var(--light);
    margin-bottom: 20px;
}

.empty-state h5 {
    color: var(--secondary);
    margin-bottom: 10px;
}

.empty-state p {
    color: var(--secondary);
    opacity: 0.7;
}

/* Tooltip custom */
.tooltip-inner {
    background: var(--dark);
    border-radius: var(--border-radius);
    padding: 8px 12px;
}

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

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

/* Dropdown */
.dropdown-menu {
    border: none;
    box-shadow: var(--shadow-lg);
    border-radius: var(--border-radius);
}

.dropdown-item {
    padding: 10px 16px;
}

.dropdown-item:hover {
    background: var(--light);
}

/* Modal */
.modal-content {
    border: none;
    border-radius: var(--border-radius-lg);
}

.modal-header {
    border-bottom: 1px solid var(--light);
}

.modal-footer {
    border-top: 1px solid var(--light);
}

/* Toggle Switch */
.form-switch .form-check-input {
    width: 48px;
    height: 24px;
    cursor: pointer;
}

.form-switch .form-check-input:checked {
    background-color: var(--primary);
    border-color: var(--primary);
}

/* Ticket Priority Colors */
.priority-low { color: var(--secondary); }
.priority-medium { color: var(--info); }
.priority-high { color: var(--warning); }
.priority-critical { color: var(--danger); }

/* Usage Bar inline */
.usage-bar-inline {
    display: flex;
    align-items: center;
    gap: 10px;
}

.usage-bar-inline .progress {
    flex: 1;
    height: 6px;
}

.usage-bar-inline .value {
    min-width: 45px;
    font-size: 0.85rem;
    font-weight: 500;
}
