/* Distributors App Custom Styles */

:root {
    --primary-color: #0d6efd;
    --success-color: #198754;
    --sidebar-width: 260px;
    --sidebar-bg: #1e293b;
    --sidebar-text: #94a3b8;
    --sidebar-text-hover: #ffffff;
    --sidebar-active-bg: rgba(255, 255, 255, 0.1);
}

body {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background-color: #f8f9fa;
}

main {
    flex: 1;
}

/* ===== SIDEBAR STYLES ===== */
.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: var(--sidebar-width);
    height: 100vh;
    background-color: var(--sidebar-bg);
    color: var(--sidebar-text);
    display: flex;
    flex-direction: column;
    z-index: 1040;
    transition: transform 0.3s ease-in-out;
}

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

.sidebar-brand a {
    color: #ffffff;
}

.sidebar-brand a:hover {
    color: #ffffff;
}

.sidebar-nav {
    flex: 1;
    overflow-y: auto;
    padding: 1rem 0;
}

.sidebar-nav .nav-item {
    margin: 0.125rem 0.75rem;
}

.sidebar-nav .nav-link {
    display: flex;
    align-items: center;
    padding: 0.75rem 1rem;
    color: var(--sidebar-text);
    border-radius: 8px;
    transition: all 0.2s ease;
}

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

.sidebar-nav .nav-link:hover {
    color: var(--sidebar-text-hover);
    background-color: var(--sidebar-active-bg);
}

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

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

.language-toggle .btn {
    border-color: rgba(255, 255, 255, 0.2);
    color: var(--sidebar-text);
}

.language-toggle .btn:hover {
    background-color: rgba(255, 255, 255, 0.1);
    color: var(--sidebar-text-hover);
}

.user-info {
    color: var(--sidebar-text);
}

.user-info .user-name {
    color: var(--sidebar-text-hover);
}

.user-info .user-avatar i {
    color: var(--sidebar-text);
}

/* Main Content with Sidebar */
.main-content {
    margin-left: var(--sidebar-width);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Mobile Header */
.mobile-header {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 60px;
    background-color: #ffffff;
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
    z-index: 1030;
    padding: 0 1rem;
    align-items: center;
    justify-content: space-between;
}

/* Sidebar Overlay */
.sidebar-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 1035;
}

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

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

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

    .mobile-header {
        display: flex;
    }

    .main-content {
        margin-left: 0;
        padding-top: 60px;
    }

    body.sidebar-open {
        overflow: hidden;
    }
}

/* ===== END SIDEBAR STYLES ===== */

/* Navbar (legacy - for non-sidebar pages) */
.navbar-brand {
    font-weight: 600;
}

/* Cards */
.card {
    border: none;
    border-radius: 10px;
}

.card-header {
    background-color: #fff;
    border-bottom: 1px solid rgba(0,0,0,0.1);
    font-weight: 600;
}

/* Tables */
.table th {
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.5px;
    color: #6c757d;
}

.table td {
    vertical-align: middle;
}

/* Best Price Highlighting */
.best-price {
    background-color: rgba(25, 135, 84, 0.1) !important;
}

.best-price td {
    border-color: rgba(25, 135, 84, 0.2);
}

/* Animation for best prices */
@keyframes pulse {
    0% { background-color: rgba(25, 135, 84, 0.1); }
    50% { background-color: rgba(25, 135, 84, 0.2); }
    100% { background-color: rgba(25, 135, 84, 0.1); }
}

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

/* Form Controls */
.form-control:focus,
.form-check-input:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.2rem rgba(13, 110, 253, 0.15);
}

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

/* Buttons */
.btn {
    border-radius: 6px;
    font-weight: 500;
}

.btn-outline-primary:hover,
.btn-outline-danger:hover {
    color: #fff;
}

/* Login page */
.min-vh-100 {
    min-height: 100vh;
}

/* Modals */
.modal-content {
    border: none;
    border-radius: 10px;
}

.modal-header {
    border-bottom: 1px solid rgba(0,0,0,0.1);
}

.modal-footer {
    border-top: 1px solid rgba(0,0,0,0.1);
}

/* Alert animations */
.alert {
    animation: slideIn 0.3s ease-out;
}

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

/* Responsive adjustments */
@media (max-width: 768px) {
    .table-responsive {
        font-size: 0.875rem;
    }
    
    .btn-sm {
        padding: 0.25rem 0.5rem;
    }
    
    h1 {
        font-size: 1.5rem;
    }
}

/* Summary cards on dashboard */
.card.bg-primary,
.card.bg-success,
.card.bg-info {
    border-radius: 10px;
}

.card.bg-primary .display-4,
.card.bg-success .display-4,
.card.bg-info .display-4 {
    font-size: 2.5rem;
}

/* Permission check icons */
.bi-check-circle-fill {
    font-size: 1rem;
}

.bi-x-circle {
    font-size: 1rem;
}

/* Role cards */
.card.h-100 {
    transition: transform 0.2s ease-in-out;
}

.card.h-100:hover {
    transform: translateY(-2px);
}

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

.dropdown-item {
    padding: 0.5rem 1rem;
}

.dropdown-item:hover {
    background-color: rgba(13, 110, 253, 0.1);
}

/* Footer */
footer {
    border-top: 1px solid rgba(0,0,0,0.05);
}
