/* File:  admin_side/assets/css/unified-layout.css */

/* Layout Base Classes */
.layout-sidebar {
    margin: 0;
    padding: 0;
    background: var(--gray-50);
}

.layout-top {
    margin: 0;
    padding: 0;
    background: var(--gray-50);
}

/* Sidebar Layout */
.app-layout-sidebar {
    display: flex;
    min-height: 100vh;
    position: relative;
}

.unified-sidebar {
    width: 260px;
    background: white;
    border-right: 1px solid var(--gray-200);
    padding: var(--space-6);
    position: fixed;
    height: 100vh;
    overflow-y: auto;
    z-index: 1000;
    box-shadow: var(--shadow-sm);
    left: 0;
    top: 0;
}

.sidebar-brand {
    font-size: 20px;
    font-weight: 700;
    color: var(--primary-500);
    margin-bottom: var(--space-6);
    display: flex;
    align-items: center;
    gap: var(--space-2);
    padding-bottom: var(--space-4);
    border-bottom: 1px solid var(--gray-200);
}

.sidebar-menu {
    list-style: none;
    margin: 0;
    padding: 0;
}

.sidebar-item {
    margin-bottom: var(--space-1);
}

.sidebar-link {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--space-3);
    color: var(--gray-700);
    text-decoration: none;
    border-radius: var(--radius-md);
    transition: all var(--transition-normal);
    font-weight: 500;
    position: relative;
}

.sidebar-link:hover,
.sidebar-link.active {
    background-color: var(--primary-500);
    color: white;
    transform: translateX(4px);
    text-decoration: none;
}

.link-content {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    flex: 1;
}

.link-text {
    font-size: var(--font-size-sm);
}

.dropdown-arrow {
    transition: transform var(--transition-normal);
    font-size: 12px;
}

.sidebar-item.has-submenu.open .dropdown-arrow {
    transform: rotate(180deg);
}

/* Sidebar Sub-menu */
.sidebar-submenu {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
    background: var(--gray-50);
    margin: var(--space-1) 0;
    border-radius: var(--radius-md);
    list-style: none;
    padding: 0;
}

.sidebar-submenu.open {
    max-height: 400px;
    padding: var(--space-2) 0;
}

.sidebar-submenu .sidebar-link {
    padding: var(--space-2) var(--space-4);
    font-size: var(--font-size-xs);
    font-weight: 400;
    margin: 0;
    transform: none;
}

.sidebar-submenu .sidebar-link:hover {
    background: var(--gray-200);
    color: var(--gray-800);
    transform: translateX(8px);
}

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

/* Main Content */
.main-content {
    flex: 1;
    margin-left: 260px;
    min-height: 100vh;
    background: var(--gray-50);
}

.content-wrapper {
    padding: var(--space-6);
}

/* Mobile Sidebar Toggle */
.mobile-sidebar-toggle {
    display: none;
    position: fixed;
    top: 20px;
    left: 20px;
    z-index: 1001;
    background: var(--primary-500);
    color: white;
    border: none;
    border-radius: var(--radius-md);
    padding: var(--space-3);
    cursor: pointer;
    box-shadow: var(--shadow-lg);
    font-size: var(--font-size-base);
}

.mobile-sidebar-toggle:hover {
    background: var(--primary-600);
}

/* Notification Badge */
.notification-badge {
    background: var(--danger-500);
    color: white;
    border-radius: 50%;
    padding: 2px 6px;
    font-size: 10px;
    font-weight: 600;
    margin-left: 8px;
    min-width: 18px;
    text-align: center;
}

/* Sidebar Divider */
.sidebar-divider {
    height: 1px;
    background: var(--gray-200);
    margin: var(--space-4) 0;
}

/* Mobile Responsive */
@media (max-width: 1024px) {
    .mobile-sidebar-toggle {
        display: block;
    }

    .unified-sidebar {
        transform: translateX(-100%);
        transition: transform 0.3s ease;
    }

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

    .main-content {
        margin-left: 0;
    }

    .content-wrapper {
        padding: var(--space-4);
        padding-top: 80px; /* Account for mobile toggle button */
    }
}

/* Enhanced Dashboard Styles */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin: 20px 0;
}

.stat-card {
    background: #fff;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    border-left: 4px solid #007bff;
}

.stat-card.verification-needed {
    border-left-color: #ffc107;
    background: #fff3cd;
}

.stat-card h3 {
    margin: 0 0 10px 0;
    color: #333;
    font-size: 16px;
}

.stat-value {
    font-size: 24px;
    font-weight: bold;
    color: #007bff;
    margin-bottom: 10px;
}

.stat-details {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.stat-details span {
    font-size: 12px;
    color: #666;
}

.stat-details .pending {
    color: #ffc107;
}

.stat-details .confirmed {
    color: #28a745;
}

.stat-details .delivered {
    color: #17a2b8;
}

.stat-details .this-month {
    color: #007bff;
}

.stat-details .last-month {
    color: #6c757d;
}

/* Loading states */
.loading-spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #007bff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Notifications */
.notification {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 15px 20px;
    border-radius: 4px;
    color: white;
    z-index: 1000;
    animation: slideIn 0.3s ease;
}

.notification-info {
    background: #17a2b8;
}

.notification-success {
    background: #28a745;
}

.notification-warning {
    background: #ffc107;
    color: #212529;
}

.notification-error {
    background: #dc3545;
}

@keyframes slideIn {
    from { transform: translateX(100%); }
    to { transform: translateX(0); }
}

/* Enhanced JavaScript UI Components */
.notification-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 1050;
    max-width: 400px;
}

.notification {
    margin-bottom: 10px;
    padding: 15px 20px;
    border-radius: 8px;
    color: white;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    position: relative;
    animation: slideIn 0.3s ease;
}

.notification-close {
    position: absolute;
    top: 5px;
    right: 10px;
    background: none;
    border: none;
    color: white;
    font-size: 18px;
    cursor: pointer;
    opacity: 0.7;
}

.notification-close:hover {
    opacity: 1;
}

/* Loading states */
.loading {
    position: relative;
    pointer-events: none;
}

.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid #007bff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

/* Form validation */
.is-invalid {
    border-color: #dc3545;
}

.is-valid {
    border-color: #28a745;
}

.invalid-feedback {
    display: block;
    width: 100%;
    margin-top: 0.25rem;
    font-size: 0.875rem;
    color: #dc3545;
}

/* Dashboard specific styles */
.dashboard-loading {
    text-align: center;
    padding: 50px;
    display: none;
}

.dashboard-content {
    display: block;
}

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

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

/* Orders page specific styles */
.bulk-actions {
    background: #f8f9fa;
    padding: 10px 15px;
    border-radius: 5px;
    margin-bottom: 15px;
    display: none;
}

.bulk-action-count {
    font-weight: bold;
    color: #007bff;
}

.quick-filters {
    margin-bottom: 20px;
}

.quick-filters .btn {
    margin-right: 5px;
    margin-bottom: 5px;
}

.quick-filters .btn.active {
    background-color: #007bff;
    border-color: #007bff;
    color: white;
}

/* Data table enhancements */
.data-table {
    width: 100% !important;
}

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

.data-table td {
    vertical-align: middle;
}

.data-table .btn-group .btn {
    margin-right: 2px;
}

.data-table .btn-group .btn:last-child {
    margin-right: 0;
}

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

.chart-container canvas {
    max-height: 100%;
}

/* Notification items */
.notification-item {
    display: flex;
    align-items: center;
    padding: 15px;
    border-bottom: 1px solid #eee;
    transition: background-color 0.2s ease;
}

.notification-item:hover {
    background-color: #f8f9fa;
}

.notification-item:last-child {
    border-bottom: none;
}

.notification-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 15px;
    font-size: 18px;
}

.notification-item.info .notification-icon {
    background-color: #d1ecf1;
    color: #0c5460;
}

.notification-item.success .notification-icon {
    background-color: #d4edda;
    color: #155724;
}

.notification-item.warning .notification-icon {
    background-color: #fff3cd;
    color: #856404;
}

.notification-item.error .notification-icon {
    background-color: #f8d7da;
    color: #721c24;
}

.notification-content {
    flex: 1;
}

.notification-title {
    font-weight: 600;
    margin-bottom: 5px;
}

.notification-message {
    color: #666;
    font-size: 14px;
    margin-bottom: 5px;
}

.notification-time {
    font-size: 12px;
    color: #999;
}

.notification-actions {
    margin-left: 15px;
}

/* Responsive improvements */
@media (max-width: 768px) {
    .notification-container {
        left: 10px;
        right: 10px;
        max-width: none;
    }
    
    .bulk-actions {
        flex-direction: column;
        align-items: stretch;
    }
    
    .bulk-actions .btn {
        margin-bottom: 5px;
        margin-right: 0;
    }
    
    .data-table .btn-group {
        flex-direction: column;
    }
    
    .data-table .btn-group .btn {
        margin-bottom: 2px;
        margin-right: 0;
    }
}

/* Animation improvements */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

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

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

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

/* Progress bars */
.progress {
    height: 8px;
    border-radius: 4px;
    background-color: #e9ecef;
    overflow: hidden;
}

.progress-bar {
    height: 100%;
    background-color: #007bff;
    transition: width 0.6s ease;
}

/* Badge improvements */
.badge {
    font-size: 0.75em;
    padding: 0.375rem 0.5rem;
    border-radius: 0.25rem;
}

.badge-warning {
    background-color: #ffc107;
    color: #212529;
}

.badge-success {
    background-color: #28a745;
    color: white;
}

.badge-info {
    background-color: #17a2b8;
    color: white;
}

.badge-danger {
    background-color: #dc3545;
    color: white;
}

.badge-secondary {
    background-color: #6c757d;
    color: white;
}

/* Button improvements */
.btn {
    transition: all 0.2s ease;
}

.btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.btn:active {
    transform: translateY(0);
}

/* Modal improvements */
.modal-content {
    border-radius: 8px;
    border: none;
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
}

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

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