/* Hargeisa Plastic Factory - Modern Design with Sidebar */
:root {
    --primary-color: #6366f1;
    --primary-dark: #4f46e5;
    --secondary-color: #8b5cf6;
    --success-color: #10b981;
    --warning-color: #f59e0b;
    --danger-color: #ef4444;
    --info-color: #06b6d4;
    --light-color: #f8fafc;
    --dark-color: #1e293b;
    --sidebar-width: 280px;
    --sidebar-collapsed-width: 80px;
    --header-height: 70px;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
    --border-radius: 12px;
    --border-radius-lg: 16px;
}

/* Global Styles */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Inter', 'Segoe UI', system-ui, -apple-system, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    color: var(--dark-color);
    overflow-x: hidden;
}

/* Layout Container */
.app-container {
    display: flex;
    min-height: 100vh;
}

/* Sidebar Styles */
.sidebar {
    position: fixed;
    left: 0;
    top: 0;
    height: 100vh;
    width: var(--sidebar-width);
    background: linear-gradient(180deg, #1e293b 0%, #0f172a 100%);
    box-shadow: var(--shadow-xl);
    transition: var(--transition);
    z-index: 1000;
    overflow-y: auto;
    overflow-x: hidden;
}

.sidebar::-webkit-scrollbar {
    width: 6px;
}

.sidebar::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
}

.sidebar::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 3px;
}

.sidebar::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.3);
}

.sidebar.collapsed {
    width: var(--sidebar-collapsed-width);
}

/* Sidebar Header */
.sidebar-header {
    padding: 1.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: var(--header-height);
}

.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    color: white;
    font-size: 1.5rem;
    font-weight: 700;
    white-space: nowrap;
    transition: var(--transition);
}

.sidebar.collapsed .sidebar-brand {
    opacity: 0;
    pointer-events: none;
}

.sidebar-toggle {
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: white;
    width: 36px;
    height: 36px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition);
}

.sidebar-toggle:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: scale(1.05);
}

/* Sidebar Menu */
.sidebar-menu {
    padding: 1rem 0;
}

.menu-section {
    margin-bottom: 2rem;
}

.menu-section-title {
    padding: 0.75rem 1.5rem;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: rgba(255, 255, 255, 0.5);
    transition: var(--transition);
}

.sidebar.collapsed .menu-section-title {
    opacity: 0;
    height: 0;
    padding: 0;
    margin: 0;
}

.menu-item {
    display: flex;
    align-items: center;
    padding: 0.875rem 1.5rem;
    color: rgba(255, 255, 255, 0.7);
    text-decoration: none;
    transition: var(--transition);
    position: relative;
    border-left: 3px solid transparent;
}

.menu-item:hover {
    background: rgba(255, 255, 255, 0.05);
    color: white;
    border-left-color: var(--primary-color);
}

.menu-item.active {
    background: rgba(99, 102, 241, 0.15);
    color: white;
    border-left-color: var(--primary-color);
}

.menu-item.active::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 3px;
    background: var(--primary-color);
    box-shadow: 0 0 10px var(--primary-color);
}

.menu-icon {
    width: 24px;
    height: 24px;
    margin-right: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    flex-shrink: 0;
}

.menu-text {
    font-weight: 500;
    font-size: 0.95rem;
    white-space: nowrap;
    transition: var(--transition);
}

.sidebar.collapsed .menu-text {
    opacity: 0;
    width: 0;
    overflow: hidden;
}

.sidebar.collapsed .menu-item {
    justify-content: center;
    padding: 0.875rem;
}

.sidebar.collapsed .menu-icon {
    margin-right: 0;
}

/* Main Content Area */
.main-content {
    flex: 1;
    margin-left: var(--sidebar-width);
    transition: var(--transition);
    min-height: 100vh;
}

.sidebar.collapsed ~ .main-content {
    margin-left: var(--sidebar-collapsed-width);
}

/* Top Header */
.top-header {
    background: white;
    height: var(--header-height);
    box-shadow: var(--shadow-md);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 2rem;
    position: sticky;
    top: 0;
    z-index: 100;
}

.page-title {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--dark-color);
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
}

/* Content Wrapper */
.content-wrapper {
    padding: 2rem;
}

/* Modern Cards */
.modern-card {
    background: white;
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow-md);
    transition: var(--transition);
    overflow: hidden;
    border: 1px solid rgba(0, 0, 0, 0.05);
}

.modern-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.card-header-modern {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    padding: 1.5rem;
    font-weight: 600;
    font-size: 1.1rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.card-body-modern {
    padding: 1.5rem;
}

/* Stat Cards */
.stat-card-modern {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    border-radius: var(--border-radius-lg);
    padding: 2rem;
    position: relative;
    overflow: hidden;
    box-shadow: var(--shadow-lg);
    transition: var(--transition);
}

.stat-card-modern:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-xl);
}

.stat-card-modern::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255,255,255,0.1) 0%, transparent 70%);
    animation: pulse 3s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 0.5; }
    50% { opacity: 1; }
}

.stat-card-modern.success {
    background: linear-gradient(135deg, var(--success-color), #059669);
}

.stat-card-modern.warning {
    background: linear-gradient(135deg, var(--warning-color), #d97706);
}

.stat-card-modern.danger {
    background: linear-gradient(135deg, var(--danger-color), #dc2626);
}

.stat-number {
    font-size: 2.5rem;
    font-weight: 700;
    margin: 0.5rem 0;
    position: relative;
    z-index: 1;
}

.stat-label {
    font-size: 0.95rem;
    opacity: 0.9;
    font-weight: 500;
    position: relative;
    z-index: 1;
}

/* Buttons */
.btn-modern {
    border-radius: var(--border-radius);
    font-weight: 600;
    padding: 0.75rem 1.5rem;
    transition: var(--transition);
    border: none;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.95rem;
    box-shadow: var(--shadow-sm);
}

.btn-modern:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.btn-primary-modern {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
}

.btn-success-modern {
    background: linear-gradient(135deg, var(--success-color), #059669);
    color: white;
}

.btn-danger-modern {
    background: linear-gradient(135deg, var(--danger-color), #dc2626);
    color: white;
}

.btn-secondary-modern {
    background: linear-gradient(135deg, #64748b, #475569);
    color: white;
}

/* Form Controls */
.form-control-modern,
.form-select-modern {
    border: 2px solid #e2e8f0;
    border-radius: var(--border-radius);
    padding: 0.875rem 1rem;
    transition: var(--transition);
    font-size: 1rem;
    background: white;
}

.form-control-modern:focus,
.form-select-modern:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
    outline: none;
}

.form-label-modern {
    font-weight: 600;
    color: var(--dark-color);
    margin-bottom: 0.5rem;
    font-size: 0.95rem;
}

/* Tables */
.table-modern {
    border-radius: var(--border-radius);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    background: white;
}

.table-modern thead th {
    background: linear-gradient(135deg, var(--dark-color), #334155);
    color: white;
    border: none;
    font-weight: 600;
    padding: 1.25rem 1rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-size: 0.85rem;
}

.table-modern tbody tr {
    transition: var(--transition);
    border-bottom: 1px solid #f1f5f9;
}

.table-modern tbody tr:hover {
    background: #f8fafc;
    transform: scale(1.01);
}

.table-modern tbody td {
    padding: 1.25rem 1rem;
    vertical-align: middle;
}

/* Alerts */
.alert-modern {
    border: none;
    border-radius: var(--border-radius);
    padding: 1.25rem 1.5rem;
    margin-bottom: 1.5rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    box-shadow: var(--shadow-sm);
}

.alert-modern.success {
    background: linear-gradient(135deg, #ecfdf5, white);
    color: #065f46;
    border-left: 4px solid var(--success-color);
}

.alert-modern.danger {
    background: linear-gradient(135deg, #fef2f2, white);
    color: #991b1b;
    border-left: 4px solid var(--danger-color);
}

.alert-modern.info {
    background: linear-gradient(135deg, #ecfeff, white);
    color: #0e7490;
    border-left: 4px solid var(--info-color);
}

.alert-modern.warning {
    background: linear-gradient(135deg, #fffbeb, white);
    color: #92400e;
    border-left: 4px solid var(--warning-color);
}

/* Badges */
.badge-modern {
    font-weight: 600;
    padding: 0.5rem 0.875rem;
    border-radius: 999px;
    font-size: 0.85rem;
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
}

.badge-success {
    background: rgba(16, 185, 129, 0.1);
    color: var(--success-color);
}

.badge-danger {
    background: rgba(239, 68, 68, 0.1);
    color: var(--danger-color);
}

.badge-warning {
    background: rgba(245, 158, 11, 0.1);
    color: var(--warning-color);
}

/* Responsive Design */
@media (max-width: 1024px) {
    .main-content {
        margin-left: 0;
    }
    
    .content-wrapper {
        padding: 1rem;
    }
}

/* Show toggle button when sidebar is collapsed or on mobile */
#mobileMenuBtn {
    display: none; /* Hidden by default */
}

@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
    }
    
    .sidebar.show {
        transform: translateX(0);
    }
    
    /* Show mobile menu button on mobile screens */
    #mobileMenuBtn {
        display: inline-flex !important;
    }
    
    /* Sidebar backdrop overlay */
    .sidebar.show::before {
        content: '';
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(0, 0, 0, 0.5);
        z-index: -1;
        animation: fadeIn 0.3s ease-out;
    }
    
    @keyframes fadeIn {
        from { opacity: 0; }
        to { opacity: 1; }
    }
}

@media (max-width: 768px) {
    .top-header {
        padding: 0 1rem;
    }
    
    .page-title {
        font-size: 1.5rem;
    }
    
    .stat-number {
        font-size: 2rem;
    }
    
    .card-body-modern {
        padding: 1rem;
    }
    
    /* Mobile menu button styling */
    #mobileMenuBtn {
        background: var(--primary-color);
        color: white;
        border: none;
        padding: 0.5rem 1rem;
        border-radius: var(--border-radius);
        cursor: pointer;
        transition: var(--transition);
    }
    
    #mobileMenuBtn:hover {
        background: var(--primary-dark);
    }
}

/* Animation Utilities */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in-up {
    animation: fadeInUp 0.5s ease-out;
}

/* Text Gradient */
.text-gradient {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Grid Layout */
.grid-auto {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
}

/* Flex Utilities */
.flex-between {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.flex-center {
    display: flex;
    justify-content: center;
    align-items: center;
}

/* Spacing */
.mb-section {
    margin-bottom: 2rem;
}

.mt-section {
    margin-top: 2rem;
}

/* Scrollbar Styling */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f5f9;
}

::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

