/* Custom ISP Manager Styles */

/* CSS Variables */
:root {
    --sidebar-width: 280px;
    --sidebar-collapsed-width: 60px;
    --primary-color: #0d6efd;
    --secondary-color: #6c757d;
    --success-color: #198754;
    --warning-color: #ffc107;
    --danger-color: #dc3545;
    --info-color: #0dcaf0;
    --dark-color: #212529;
    --light-color: #f8f9fa;
}

/* Body Styles */
body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #f5f5f5;
    min-height: 100vh;
}

/* Sidebar Styles */
.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    width: var(--sidebar-width);
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    transition: all 0.3s ease;
    z-index: 1040;
    overflow-y: auto;
    overflow-x: hidden;
}

.sidebar.collapsed {
    width: var(--sidebar-collapsed-width);
}

.sidebar-header {
    padding: 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    min-height: 70px;
    gap: 0.5rem;
}

.sidebar-title {
    font-size: 1.1rem;
    font-weight: 600;
    margin: 0;
    flex: 1;
    min-width: 0;
    transition: opacity 0.3s ease;
}

.sidebar-title span {
    white-space: normal;
    word-wrap: break-word;
    overflow-wrap: break-word;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sidebar.collapsed .sidebar-title {
    opacity: 0;
    visibility: hidden;
}

.sidebar-title img,
.sidebar-title i.fa-wifi {
    flex-shrink: 0;
}

#sidebarCollapse {
    color: white;
    padding: 0.25rem 0.5rem;
    flex-shrink: 0;
    align-self: flex-start;
}

#sidebarCollapse:hover {
    color: rgba(255, 255, 255, 0.8);
}

.sidebar-nav {
    list-style: none;
    padding: 0;
    margin: 0;
    height: calc(100vh - 80px);
    display: flex;
    flex-direction: column;
}

.sidebar-nav .nav-item {
    margin: 0;
}

.sidebar-nav .nav-link {
    display: flex;
    align-items: center;
    padding: 1rem;
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.sidebar-nav .nav-link:hover,
.sidebar-nav .nav-link.active {
    background-color: rgba(255, 255, 255, 0.1);
    color: white;
    transform: translateX(5px);
}

.sidebar-nav .nav-link i {
    width: 20px;
    text-align: center;
    flex-shrink: 0;
}

.sidebar.collapsed .nav-link {
    justify-content: center;
    padding: 1rem 0.5rem;
}

.sidebar.collapsed .nav-link i {
    margin-right: 0 !important;
}

.sidebar.collapsed .nav-link span,
.sidebar.collapsed .nav-link .nav-text {
    display: none;
}

/* Sidebar Submenu Styles */
.sidebar-submenu {
    list-style: none;
    padding: 0;
    margin: 0;
    background-color: rgba(0, 0, 0, 0.1);
}

.collapse {
    transition: height 0.3s ease;
}

.collapse:not(.show) {
    display: none;
}

.collapse.show {
    display: block;
}

.sidebar-submenu .nav-item {
    margin: 0;
}

.sidebar-submenu .nav-link {
    padding: 0.75rem 1rem 0.75rem 3rem;
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.7);
}

.sidebar-submenu .nav-link:hover,
.sidebar-submenu .nav-link.active {
    background-color: rgba(255, 255, 255, 0.15);
    color: white;
}

.sidebar-submenu .nav-link i {
    width: 16px;
    font-size: 0.85rem;
}

.sidebar.collapsed .sidebar-submenu {
    display: none;
}

.sidebar.collapsed .dropdown-toggle::after {
    display: none;
}

/* Dropdown arrow for nav items */
.nav-link.dropdown-toggle::after {
    content: '\f107';
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    border: none;
    vertical-align: 0;
    margin-left: auto;
    transition: transform 0.3s ease;
}

.nav-link.dropdown-toggle[aria-expanded="true"]::after {
    transform: rotate(180deg);
}

.sidebar.collapsed .nav-link.dropdown-toggle::after {
    display: none;
}

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

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

/* Navbar Styles */
.navbar {
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* Cards */
.card {
    border: none;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
}

.card-header {
    background-color: white;
    border-bottom: 2px solid #f8f9fa;
    border-radius: 10px 10px 0 0 !important;
}

/* Responsive helper: negative top margin only on desktop */
@media (min-width: 992px) {
    .mt-desktop-neg-66 { margin-top: -66px !important; }
}

/* Buttons */
.btn {
    border-radius: 6px;
    font-weight: 500;
    transition: all 0.2s ease;
}

.btn:hover {
    transform: translateY(-1px);
}

/* Tables */
.table {
    border-radius: 8px;
    overflow: hidden;
}

.table th {
    background-color: #f8f9fa;
    border-top: none;
    font-weight: 600;
    color: #495057;
}

/* Improve spacing and readability in CRUD tables */
.table.data-table th,
.table.data-table td {
    padding: 0.9rem 1rem; /* increase from default ~0.5rem */
    vertical-align: middle;
}

/* Keep action buttons tidy within table cells */
.table.data-table .btn-group .btn,
.table.data-table .btn {
    padding: 0.35rem 0.6rem;
}

/* Prevent tight wrapping of small metadata inside table */
.table.data-table small,
.table.data-table .badge {
    line-height: 1.1;
}

.table-hover tbody tr:hover {
    background-color: rgba(0, 123, 255, 0.05);
}

/* Status Badges */
.badge {
    font-size: 0.75rem;
    padding: 0.5em 0.75em;
    border-radius: 6px;
}

/* Forms */
.form-control,
.form-select {
    border-radius: 6px;
    border: 1px solid #dee2e6;
    transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
}

.form-control:focus,
.form-select:focus {
    box-shadow: 0 0 0 0.2rem rgba(13, 110, 253, 0.25);
}

/* Alerts */
.alert {
    border: none;
    border-radius: 8px;
    padding: 1rem 1.25rem;
}

/* Loading States */
.spinner-border-sm {
    width: 1rem;
    height: 1rem;
}

/* DataTables Customization */
.dataTables_wrapper .dataTables_filter input {
    border-radius: 6px;
    border: 1px solid #dee2e6;
    padding: 0.375rem 0.75rem;
    margin-left: 0.5rem;
}

.dataTables_wrapper .dataTables_length select {
    border-radius: 6px;
    border: 1px solid #dee2e6;
    padding: 0.375rem 0.75rem;
    margin: 0 0.5rem;
}

.dataTables_wrapper .dataTables_paginate .paginate_button.current {
    background-color: var(--primary-color) !important;
    border-color: var(--primary-color) !important;
    color: white !important;
}

/* Select2 Customization */
.select2-container--bootstrap-5 .select2-selection {
    border-radius: 6px;
}

/* Chart Containers */
.chart-container {
    position: relative;
    height: 300px;
    width: 100%;
}

/* Mobile Responsiveness */
@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
    }
    
    .sidebar.show {
        transform: translateX(0);
    }
    
    .content {
        margin-left: 0;
    }
    
    .sidebar.collapsed + .content {
        margin-left: 0;
    }
}

/* Animation Classes */
.fade-in {
    animation: fadeIn 0.5s ease-in;
}

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

.slide-up {
    animation: slideUp 0.3s ease-out;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Utility Classes */
.text-gradient {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.shadow-soft {
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
}

.border-radius-lg {
    border-radius: 10px;
}

.min-vh-100 {
    min-height: 100vh;
}

/* Custom Scrollbar */
.sidebar::-webkit-scrollbar {
    width: 6px;
}

.sidebar::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.1);
}

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

.sidebar::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.5);
}

/* Print Styles */
@media print {
    .sidebar,
    .navbar,
    .btn,
    .pagination {
        display: none !important;
    }
    
    .content {
        margin-left: 0 !important;
    }
    
    .card {
        box-shadow: none !important;
        border: 1px solid #dee2e6 !important;
    }
}
