/**
 * Vendor Management System - Custom Styles
 */

/* Root Variables */
:root {
    --primary-gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --sidebar-width: 230px;
    --sidebar-collapsed-width: 60px;
    --header-height: 50px;
}

/* Global Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #f4f6f9;
    min-height: 100vh;
    font-size: 0.875rem;
}

/* Wrapper */
.wrapper {
    display: flex;
    min-height: 100vh;
}

/* Sidebar Styles */
#sidebar {
    width: var(--sidebar-width);
    min-height: 100vh;
    position: fixed;
    left: 0;
    top: 0;
    z-index: 1000;
    transition: all 0.3s ease;
}

#sidebar.collapsed {
    width: var(--sidebar-collapsed-width);
    overflow: hidden;
}

#sidebar.collapsed .sidebar-header h4 span,
#sidebar.collapsed .sidebar-header small,
#sidebar.collapsed .nav-link span,
#sidebar.collapsed .sidebar-section-label,
#sidebar.collapsed .sidebar-footer .flex-grow-1 {
    display: none !important;
}

#sidebar.collapsed .sidebar-header {
    justify-content: center !important;
}

#sidebar.collapsed .sidebar-header > div:first-child {
    display: none !important;
}

#sidebar.collapsed .nav-link {
    text-align: center;
    padding: 15px;
    font-size: 0;
    white-space: nowrap;
    overflow: hidden;
}

#sidebar.collapsed .nav-link i {
    margin: 0 !important;
    font-size: 1.25rem;
}

#sidebar.collapsed .components {
    padding: 10px 5px !important;
}

.sidebar-header {
    background: rgba(0, 0, 0, 0.1);
}

.sidebar-footer {
    background: rgba(0, 0, 0, 0.1);
}

/* Sidebar scrollable menu */
#sidebar .components {
    overflow-y: auto;
    max-height: calc(100vh - 140px);
    scrollbar-width: thin;
    scrollbar-color: rgba(255,255,255,0.2) transparent;
}

#sidebar .components::-webkit-scrollbar {
    width: 4px;
}

#sidebar .components::-webkit-scrollbar-thumb {
    background: rgba(255,255,255,0.2);
    border-radius: 4px;
}

/* Sidebar backdrop for mobile */
.sidebar-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 999;
    display: none;
}

.sidebar-backdrop.show {
    display: block;
}

/* Navigation Links */
#sidebar .nav-link {
    color: rgba(255, 255, 255, 0.8);
    padding: 8px 12px;
    border-radius: 6px;
    margin-bottom: 3px;
    transition: all 0.3s ease;
    font-size: 0.84rem;
}

#sidebar .nav-link:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
}

#sidebar .nav-link.active {
    background: var(--primary-gradient);
    color: #fff;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}

#sidebar .nav-link i {
    width: 24px;
}

/* Main Content */
#content {
    margin-left: var(--sidebar-width);
    width: calc(100% - var(--sidebar-width));
    min-height: 100vh;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
}

#content.expanded {
    margin-left: var(--sidebar-collapsed-width);
    width: calc(100% - var(--sidebar-collapsed-width));
}

/* Top Navbar */
#content > .navbar {
    background: #fff !important;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

#sidebarToggle {
    padding: 5px 10px;
}

/* Cards */
.card {
    border: none;
    border-radius: 10px;
    transition: all 0.3s ease;
}

.card:hover {
    box-shadow: 0 5px 25px rgba(0, 0, 0, 0.1) !important;
}

.card-header {
    background: transparent;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    padding: 14px 16px;
}

.card-body {
    padding: 14px 16px;
}

/* Tables */
.table {
    margin-bottom: 0;
}

.table th {
    font-weight: 600;
    color: #6c757d;
    border-top: none;
    padding: 10px 12px;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.table td {
    padding: 9px 12px;
    vertical-align: middle;
    font-size: 0.84rem;
}

.table-hover tbody tr:hover {
    background-color: rgba(102, 126, 234, 0.05);
}

/* Buttons */
.btn {
    border-radius: 6px;
    padding: 7px 14px;
    font-weight: 500;
    font-size: 0.84rem;
    transition: all 0.3s ease;
}

.btn-primary {
    background: var(--primary-gradient);
    border: none;
}

.btn-primary:hover {
    background: linear-gradient(135deg, #5a6fd6 0%, #6a4190 100%);
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}

.btn-outline-primary {
    border-color: #667eea;
    color: #667eea;
}

.btn-outline-primary:hover {
    background: var(--primary-gradient);
    border-color: transparent;
}

.btn-group-sm .btn {
    padding: 4px 8px;
    font-size: 0.78rem;
}

/* Badges */
.badge {
    font-weight: 500;
    padding: 4px 9px;
    border-radius: 5px;
    font-size: 0.75rem;
}

/* Forms */
.form-control {
    border-radius: 6px;
    padding: 8px 12px;
    border: 1px solid #e0e0e0;
    font-size: 0.84rem;
    transition: all 0.3s ease;
}

.form-control:focus {
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.15);
}

.form-select {
    border-radius: 6px;
    padding: 8px 12px;
    font-size: 0.84rem;
}

.input-group-text {
    border-radius: 8px 0 0 8px;
    border: 1px solid #e0e0e0;
    background: #f8f9fa;
}

/* Progress Bars */
.progress {
    border-radius: 10px;
    background: #e9ecef;
}

.progress-bar {
    border-radius: 10px;
}

/* Alerts */
.alert {
    border-radius: 8px;
    border: none;
    padding: 10px 14px;
    font-size: 0.84rem;
}

/* Avatar */
.avatar {
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
}

/* Footer */
.footer {
    margin-top: auto;
}

/* Pagination */
.pagination {
    gap: 5px;
}

.page-link {
    border-radius: 6px;
    border: none;
    padding: 6px 11px;
    color: #667eea;
    font-size: 0.84rem;
}

.page-item.active .page-link {
    background: var(--primary-gradient);
    color: #fff;
}

/* Upload Zone */
.upload-zone {
    cursor: pointer;
    transition: all 0.3s ease;
}

.upload-zone:hover {
    border-color: #667eea !important;
    background: rgba(102, 126, 234, 0.05) !important;
}

/* Dropdown */
.dropdown-menu {
    border: none;
    box-shadow: 0 5px 25px rgba(0, 0, 0, 0.15);
    border-radius: 10px;
    padding: 10px;
}

.dropdown-item {
    border-radius: 5px;
    padding: 7px 12px;
    font-size: 0.84rem;
    transition: all 0.2s ease;
}

.dropdown-item:hover {
    background: rgba(102, 126, 234, 0.1);
}

/* Modal */
.modal-content {
    border: none;
    border-radius: 12px;
}

.modal-header {
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    padding: 14px 16px;
}

.modal-footer {
    border-top: 1px solid rgba(0, 0, 0, 0.05);
    padding: 14px 16px;
}

/* Activity Timeline */
.activity-timeline .activity-item {
    position: relative;
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 10px;
}

::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

/* Responsive */
@media (max-width: 991.98px) {
    #sidebar {
        margin-left: calc(-1 * var(--sidebar-width));
        transition: margin-left 0.3s ease;
    }
    
    #sidebar.show {
        margin-left: 0;
        box-shadow: 5px 0 25px rgba(0, 0, 0, 0.3);
    }
    
    #content {
        margin-left: 0;
        width: 100%;
    }
    
    #content.expanded {
        margin-left: 0;
        width: 100%;
    }
}

@media (max-width: 767.98px) {
    .card-body {
        padding: 15px;
    }
    
    .table th,
    .table td {
        padding: 10px;
    }
    
    .btn {
        padding: 8px 15px;
    }
}

/* Utility Classes */
.bg-gradient {
    background: var(--primary-gradient) !important;
}

.text-gradient {
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.shadow-primary {
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

.border-dashed {
    border-style: dashed !important;
}

/* Animation */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in {
    animation: fadeIn 0.3s ease;
}

/* Print Styles */
@media print {
    #sidebar,
    .navbar,
    .btn,
    .footer {
        display: none !important;
    }
    
    #content {
        margin-left: 0 !important;
        width: 100% !important;
    }
    
    .card {
        box-shadow: none !important;
        border: 1px solid #ddd !important;
    }
}
