/* Inventory Management System CSS - Dark Theme */

:root {
    --primary-color: #0d6efd;
    --success-color: #198754;
    --danger-color: #dc3545;
    --warning-color: #ffc107;
    --info-color: #0dcaf0;
    --light-color: #f8f9fa;
    --dark-color: #212529;
    --bg-dark: #1a1a1a;
    --bg-darker: #0f0f0f;
    --green-profit: #00d4aa;
    --red-loss: #ff6b6b;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background-color: var(--bg-darker);
    min-height: 100vh;
}

/* Background styling */
.background-image {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #1a1a1a 0%, #2d2d2d 50%, #1a1a1a 100%);
    z-index: -1;
}

/* Navbar styling */
.navbar {
    background-color: var(--bg-dark) !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
}

.navbar-brand {
    font-size: 1.5rem;
    font-weight: 700;
}

/* Dashboard Cards Styling */
.dashboard-container {
    margin-bottom: 2rem;
}

.dashboard-card-main {
    background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
    border-radius: 20px;
    padding: 1.5rem;
    margin-bottom: 1rem;
    border: none;
    color: white;
}

.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 1rem;
}

.dashboard-card {
    border-radius: 16px;
    padding: 1.25rem;
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: all 0.3s ease;
    color: white;
}

.dashboard-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.2);
}

.dashboard-card-revenue {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
}

.dashboard-card-expenses {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
}

.dashboard-card-cost {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
}

.dashboard-card-margin {
    background: linear-gradient(135deg, #8b5cf6 0%, #7c3aed 100%);
}

.dashboard-card-sales {
    background: linear-gradient(135deg, #06b6d4 0%, #0891b2 100%);
}

.dashboard-card-items {
    background: linear-gradient(135deg, #64748b 0%, #475569 100%);
}

.dashboard-label {
    font-size: 0.875rem;
    font-weight: 500;
    opacity: 0.9;
}

.dashboard-period {
    font-size: 0.75rem;
    opacity: 0.8;
}

.dashboard-value {
    font-size: 1.25rem;
    font-weight: 700;
    color: white;
}

.dashboard-value-main {
    font-size: 2.25rem;
    font-weight: 800;
    color: white;
    margin: 0.5rem 0;
}

.dashboard-message {
    font-size: 0.875rem;
    opacity: 0.9;
}

.dashboard-margin {
    font-size: 0.875rem;
    opacity: 0.9;
    font-weight: 500;
}

.dashboard-icon {
    font-size: 1.125rem;
    margin-right: 0.5rem;
    opacity: 0.9;
}

/* Container styling */
.container.bg-dark {
    border-radius: 20px;
    padding: 2rem;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

/* Navigation tabs */
.nav-tabs {
    border-bottom: 2px solid rgba(255, 255, 255, 0.1);
}

.nav-tabs .nav-link {
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.7);
    font-weight: 600;
    padding: 1rem 1.5rem;
    border-radius: 12px 12px 0 0;
    transition: all 0.3s ease;
}

.nav-tabs .nav-link:hover {
    color: white;
    background: rgba(255, 255, 255, 0.05);
}

.nav-tabs .nav-link.active {
    color: white;
    background: rgba(13, 110, 253, 0.2);
    border-bottom: 3px solid var(--primary-color);
}

/* Form styling */
.form-control, .form-select {
    background-color: #2d2d2d;
    border: 2px solid #3d3d3d;
    color: white;
    border-radius: 12px;
    transition: all 0.3s ease;
    font-weight: 500;
}

.form-control:focus, .form-select:focus {
    background-color: #3d3d3d;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.2rem rgba(13, 110, 253, 0.25);
    color: white;
    transform: translateY(-1px);
}

.form-control::placeholder {
    color: #999;
    opacity: 0.7;
}

.input-group-text {
    background-color: #3d3d3d;
    border: 2px solid #3d3d3d;
    color: white;
    border-radius: 12px 0 0 12px;
    font-weight: 600;
}

/* Inventory Grid */
.inventory-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 1.5rem;
}

.inventory-item {
    background: linear-gradient(145deg, #2d2d2d, #3d3d3d);
    border-radius: 16px;
    padding: 1.5rem;
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: all 0.3s ease;
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

.inventory-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.3);
    border-color: var(--primary-color);
}

.inventory-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--success-color), var(--primary-color));
}

.inventory-item.sold-out::before {
    background: var(--danger-color);
}

.inventory-item-header {
    display: flex;
    justify-content: between;
    align-items: flex-start;
    margin-bottom: 1rem;
}

.inventory-item h5 {
    color: white;
    font-weight: 700;
    margin: 0;
    font-size: 1.1rem;
    line-height: 1.3;
}

.inventory-item-status {
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
}

.status-active {
    background: rgba(25, 135, 84, 0.2);
    color: var(--success-color);
}

.status-sold_out {
    background: rgba(220, 53, 69, 0.2);
    color: var(--danger-color);
}

.status-discontinued {
    background: rgba(255, 193, 7, 0.2);
    color: var(--warning-color);
}

.inventory-stats {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin: 1rem 0;
}

.stat-item {
    text-align: center;
    padding: 0.75rem;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 10px;
}

.stat-label {
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.8rem;
    margin-bottom: 0.25rem;
}

.stat-value {
    color: white;
    font-weight: 700;
    font-size: 1.1rem;
}

.profit-positive {
    color: var(--green-profit) !important;
}

.profit-negative {
    color: var(--red-loss) !important;
}

.quantity-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

/* Button enhancements */
.btn {
    border-radius: 12px;
    font-weight: 600;
    transition: all 0.3s ease;
    border: none;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(0,0,0,0.3);
}

.btn-primary {
    background: var(--primary-color);
    box-shadow: 0 4px 15px rgba(13, 110, 253, 0.3);
}

.btn-success {
    background: var(--success-color);
    box-shadow: 0 4px 15px rgba(25, 135, 84, 0.3);
}

.btn-outline-light:hover {
    background: rgba(255, 255, 255, 0.1);
    color: white;
    border-color: transparent;
}

/* Time period buttons */
.time-period-btn {
    border-radius: 25px;
    padding: 8px 20px;
    font-size: 0.9rem;
    transition: all 0.3s ease;
}

.time-period-btn.active {
    background: var(--primary-color);
    border-color: var(--primary-color);
    color: white;
    transform: scale(1.05);
}

/* Chart containers */
#profitChart, #platformChart {
    background: rgba(255, 255, 255, 0.02);
    border-radius: 12px;
    padding: 10px;
}

/* Modal styling */
.modal-content {
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(20px);
}

.modal-header {
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.modal-footer {
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

/* Form switches */
.form-check-input:checked {
    background-color: var(--success-color);
    border-color: var(--success-color);
}

.form-check-input:focus {
    border-color: var(--primary-color);
    outline: 0;
    box-shadow: 0 0 0 0.25rem rgba(13, 110, 253, 0.25);
}

/* Sales history styling */
.sale-entry {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    padding: 1rem;
    margin-bottom: 1rem;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.sale-platform {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    background: rgba(13, 110, 253, 0.2);
    color: var(--primary-color);
    border-radius: 15px;
    font-size: 0.8rem;
    font-weight: 600;
}

/* Top performers list */
.list-group-item {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: white;
    margin-bottom: 0.5rem;
    border-radius: 10px;
}

/* Progress indicators */
.progress {
    height: 8px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
}

.progress-bar {
    background: linear-gradient(90deg, var(--success-color), var(--primary-color));
    border-radius: 10px;
}

/* Responsive design */
@media (max-width: 768px) {
    .container {
        padding: 1rem !important;
        margin: 1rem;
    }
    
    .inventory-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .inventory-stats {
        grid-template-columns: 1fr;
        gap: 0.5rem;
    }
    
    .time-period-btn {
        font-size: 0.8rem;
        padding: 6px 15px;
    }
    
    .navbar-brand {
        font-size: 1.2rem;
    }
}

/* Footer styling */
footer {
    background-color: var(--bg-dark) !important;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    margin-top: auto;
}

/* Custom scrollbar */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #2d2d2d;
    border-radius: 10px;
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(45deg, var(--primary-color), #6f42c1);
    border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(45deg, #0b5ed7, #6f42c1);
}

/* Animation classes */
@keyframes slideInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.inventory-item {
    animation: slideInUp 0.3s ease-out;
}

/* Loading states */
.loading {
    opacity: 0.6;
    pointer-events: none;
}

.skeleton {
    background: linear-gradient(90deg, #2d2d2d 25%, #3d3d3d 50%, #2d2d2d 75%);
    background-size: 200% 100%;
    animation: loading 1.5s infinite;
}

@keyframes loading {
    0% {
        background-position: 200% 0;
    }
    100% {
        background-position: -200% 0;
    }
}

/* Print styles */
@media print {
    body {
        background: white !important;
        color: black !important;
    }
    
    .navbar, footer, .btn, .background-image {
        display: none !important;
    }
    
    .bg-dark {
        background: white !important;
        color: black !important;
        border: 1px solid #000 !important;
        box-shadow: none !important;
    }
    
    .text-white, .text-white-50 {
        color: black !important;
    }
}