/* ADTrek Affiliates - Custom Styles */

:root {
    --sidebar-width: 260px;
    --sidebar-bg: #1a1d21;
    --sidebar-color: #a0aec0;
    --sidebar-active-bg: #2d3748;
    --sidebar-active-color: #fff;
}

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

/* Sidebar */
#sidebar {
    width: var(--sidebar-width);
    min-width: var(--sidebar-width);
    max-height: 100vh;
    background: var(--sidebar-bg);
    color: var(--sidebar-color);
    transition: all 0.3s;
    display: flex;
    flex-direction: column;
    position: sticky;
    top: 0;
}

#sidebar .components {
    padding: 1rem 0;
    flex-grow: 1;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: var(--sidebar-active-bg) transparent;
}

#sidebar .components::-webkit-scrollbar {
    width: 6px;
}

#sidebar .components::-webkit-scrollbar-track {
    background: transparent;
}

#sidebar .components::-webkit-scrollbar-thumb {
    background-color: var(--sidebar-active-bg);
    border-radius: 3px;
}

#sidebar.collapsed {
    margin-left: calc(var(--sidebar-width) * -1);
}

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

#sidebar .sidebar-header a {
    color: #fff;
}

#sidebar .components li {
    margin: 0.25rem 0.75rem;
}

#sidebar .components li a {
    display: flex;
    align-items: center;
    padding: 0.75rem 1rem;
    color: var(--sidebar-color);
    text-decoration: none;
    border-radius: 0.5rem;
    transition: all 0.2s;
}

#sidebar .components li a:hover,
#sidebar .components li.active a {
    background: var(--sidebar-active-bg);
    color: var(--sidebar-active-color);
}

#sidebar .sidebar-footer {
    padding: 1rem 1.5rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

#sidebar .sidebar-footer a {
    color: var(--sidebar-color);
}

/* Content */
#content {
    width: 100%;
    min-height: 100vh;
    transition: all 0.3s;
    background: #f8f9fa;
}

/* Cards */
.card {
    border-radius: 0.75rem;
}

.card-header {
    background: transparent;
}

/* Avatar */
.avatar {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Tables */
.table > :not(caption) > * > * {
    padding: 1rem 0.75rem;
}

/* Buttons */
.btn {
    border-radius: 0.5rem;
}

/* Badges */
.badge {
    font-weight: 500;
}

/* Code blocks */
pre {
    border-radius: 0.5rem;
    font-size: 0.875rem;
}

pre code {
    white-space: pre-wrap;
    word-break: break-all;
}

/* Form elements */
.form-control,
.form-select {
    border-radius: 0.5rem;
}

.form-control:focus,
.form-select:focus {
    border-color: #0d6efd;
    box-shadow: 0 0 0 0.2rem rgba(13, 110, 253, 0.15);
}

/* Dropdown */
.dropdown-menu {
    border-radius: 0.5rem;
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
}

/* Mobile responsiveness */
@media (max-width: 768px) {
    #sidebar {
        position: fixed;
        z-index: 1000;
        height: 100vh;
    }

    #sidebar.collapsed {
        margin-left: calc(var(--sidebar-width) * -1);
    }

    #content {
        width: 100%;
    }
}

/* Utilities */
.text-truncate-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Loading spinner */
.spinner-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

/* Toast notifications */
.toast-container {
    position: fixed;
    top: 1rem;
    right: 1rem;
    z-index: 9999;
}

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

/* Stats card animation */
.card:hover {
    transform: translateY(-2px);
    transition: transform 0.2s;
}

/* Input group buttons */
.input-group .btn-outline-secondary {
    border-color: #dee2e6;
}

/* Alert improvements */
.alert {
    border-radius: 0.5rem;
    border: none;
}

/* Modal improvements */
.modal-content {
    border-radius: 0.75rem;
    border: none;
}

.modal-header {
    border-bottom: 1px solid #e9ecef;
}

.modal-footer {
    border-top: 1px solid #e9ecef;
}
