/*
 * style.css
 * Main stylesheet for the MODA application.
 */

/* --- Google Fonts --- */
@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600;700&display=swap');

/* --- CSS Variables --- */
:root {
    --primary-color: #ce4531;
    --secondary-color: #2f2f2f;
    --background-color: #f4f7fa;
    --sidebar-bg: #ffffff;
    --text-color: #333;
    --light-text-color: #777;
    --border-color: #e0e0e0;
    --white-color: #fff;
    --success-color: #28a745;
    --danger-color: #dc3545;
    --warning-color: #ffc107;
    --box-shadow: 0 4px 8px rgba(0, 0, 0, 0.05);
}

/* --- General Styles --- */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Poppins', sans-serif;
    background-color: var(--background-color);
    color: var(--text-color);
    display: flex;
    min-height: 100vh;
}

a {
    text-decoration: none;
    color: var(--primary-color);
}

ul {
    list-style-type: none;
}

/* --- Main Layout --- */
.sidebar {
    width: 260px;
    background-color: var(--sidebar-bg);
    height: 100vh;
    position: fixed;
    top: 0;
    left: 0;
    padding: 20px;
    box-shadow: 2px 0 10px rgba(0, 0, 0, 0.05);
    display: flex;
    flex-direction: column;
}

.main-content {
    margin-left: 260px;
    width: calc(100% - 260px);
    padding: 30px;
}

/* --- Sidebar Styles --- */
.sidebar .logo {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    margin-bottom: 20px;
    flex-shrink: 0;
}

.sidebar .logo .sidebar-logo {
    max-height: 100px;
    max-width: 90%;
    object-fit: contain;
}

.sidebar .logo h2 {
    font-size: 22px;
    margin: 0;
    color: var(--secondary-color);
}


.sidebar .menu {
    flex-grow: 1;
    overflow-y: auto;
    padding: 20px 0;
}

.sidebar .menu-item {
    margin-bottom: 10px;
}

.sidebar .menu-item a, .sidebar .menu-item .dropdown-toggle {
    display: flex;
    align-items: center;
    padding: 12px 15px;
    color: var(--secondary-color);
    border-radius: 8px;
    transition: background-color 0.3s, color 0.3s;
    font-weight: 500;
}

.sidebar .menu-item a:hover,
.sidebar .menu-item .dropdown-toggle:hover,
.sidebar .menu-item a.active {
    background-color: var(--primary-color);
    color: var(--white-color);
}

.sidebar .menu-item a i, .sidebar .menu-item .dropdown-toggle i {
    margin-right: 15px;
    font-size: 18px;
}

.sidebar .dropdown-content {
    padding-left: 30px;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s ease-in-out;
}

.sidebar .dropdown-content a {
    padding: 10px 15px;
    font-size: 14px;
    color: var(--light-text-color);
}

.sidebar .dropdown-content a:hover {
    color: var(--primary-color);
    background-color: transparent;
}

.sidebar .user-profile {
    margin-top: auto;
    border-top: 1px solid var(--border-color);
    padding-top: 20px;
    text-align: center;
    flex-shrink: 0;
}

.sidebar .user-profile a {
    color: var(--secondary-color);
    font-weight: 500;
}
.sidebar .user-profile a:hover {
    color: var(--primary-color);
}

/* --- Main Content Header --- */
.page-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 25px; }
.page-header h1 { font-size: 24px; font-weight: 600; color: var(--secondary-color); }
/* --- Buttons --- */
.btn { padding: 10px 20px; border: none; border-radius: 6px; cursor: pointer; font-size: 14px; font-weight: 500; transition: background-color 0.3s, box-shadow 0.3s; display: inline-flex; align-items: center; gap: 8px; }
.btn-primary { background-color: var(--primary-color); color: var(--white-color); }
.btn-primary:hover { background-color: #b83b27; box-shadow: 0 2px 5px rgba(206, 69, 49, 0.3); }
.btn-secondary { background-color: var(--secondary-color); color: var(--white-color); }
.btn-secondary:hover { background-color: #1a1a1a; }
.btn-danger { background-color: var(--danger-color); color: var(--white-color); }
.btn-danger:hover { background-color: #c82333; }
.btn-success { background-color: var(--success-color); color: var(--white-color); }
.btn-success:hover { background-color: #218838; }
.btn-sm { padding: 5px 10px; font-size: 12px; }
/* --- Card / Container --- */
.card { background-color: var(--white-color); border-radius: 10px; box-shadow: var(--box-shadow); padding: 25px; }
.card-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px; padding-bottom: 15px; border-bottom: 1px solid var(--border-color); }
.card-header h2 { font-size: 18px; font-weight: 600; color: var(--secondary-color); }
.search-bar input { padding: 8px 12px; border: 1px solid var(--border-color); border-radius: 6px; width: 250px; }
/* --- Table Styles --- */
.table-responsive { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; margin-bottom: 20px; }
th, td { padding: 12px 15px; text-align: left; border-bottom: 1px solid var(--border-color); }
thead th { background-color: #f8f9fa; font-weight: 600; color: var(--secondary-color); }
tbody tr:hover { background-color: #f8f9fa; }
td .action-btns { display: flex; gap: 10px; }
/* --- Pagination --- */
.pagination { display: flex; justify-content: flex-end; align-items: center; gap: 5px; }
.pagination a, .pagination span { color: var(--secondary-color); padding: 8px 12px; border: 1px solid var(--border-color); border-radius: 5px; transition: background-color 0.3s, color 0.3s; }
.pagination a:hover { background-color: var(--primary-color); color: var(--white-color); border-color: var(--primary-color); }
.pagination .active { background-color: var(--primary-color); color: var(--white-color); border-color: var(--primary-color); }
/* --- Modal Styles --- */
.modal { display: none; position: fixed; z-index: 1000; left: 0; top: 0; width: 100%; height: 100%; overflow: auto; background-color: rgba(0,0,0,0.5); }
.modal-content { background-color: #fefefe; margin: 10% auto; padding: 30px; border: 1px solid #888; width: 80%; max-width: 500px; border-radius: 10px; position: relative; animation: slide-down 0.4s; }
@keyframes slide-down { from { top: -100px; opacity: 0; } to { top: 0; opacity: 1; } }
.modal-header { display: flex; justify-content: space-between; align-items: center; padding-bottom: 15px; border-bottom: 1px solid var(--border-color); margin-bottom: 20px; }
.modal-header h2 { color: var(--secondary-color); }
.close-btn { color: #aaa; font-size: 28px; font-weight: bold; cursor: pointer; }
.close-btn:hover, .close-btn:focus { color: black; }
/* --- Form Styles --- */
.form-group { margin-bottom: 20px; }
.form-group label { display: block; margin-bottom: 8px; font-weight: 500; }
.form-group input, .form-group select { width: 100%; padding: 12px; border: 1px solid var(--border-color); border-radius: 6px; font-family: 'Poppins', sans-serif; }
.form-group input:focus { outline: none; border-color: var(--primary-color); box-shadow: 0 0 0 2px rgba(206, 69, 49, 0.2); }
.form-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 20px; }
.card-header .actions-group { display: flex; gap: 15px; align-items: center; }
.export-buttons { display: flex; gap: 10px; }
/* --- Table Header Sorting --- */
thead th a { color: var(--secondary-color); text-decoration: none; display: block; position: relative; transition: color 0.3s; }
thead th a:hover { color: var(--primary-color); }
thead th a i.fa-solid { margin-left: 8px; font-size: 14px; }
/* --- Image View Modal --- */
.image-modal { display: none; position: fixed; z-index: 1050; left: 0; top: 0; width: 100%; height: 100%; overflow: auto; background-color: rgba(0,0,0,0.85); justify-content: center; align-items: center; }
.image-modal-content { margin: auto; display: block; max-width: 80%; max-height: 80%; border-radius: 5px; animation: zoomIn 0.3s; }
@keyframes zoomIn { from {transform: scale(0)} to {transform: scale(1)} }
.image-modal .close-btn { position: absolute; top: 15px; right: 35px; color: #f1f1f1; font-size: 40px; font-weight: bold; transition: 0.3s; }
.image-modal .close-btn:hover, .image-modal .close-btn:focus { color: #bbb; text-decoration: none; cursor: pointer; }
/* --- Status Badge Styles --- */
.status-badge { padding: 4px 10px; border-radius: 12px; font-size: 12px; font-weight: 500; color: var(--white-color); text-transform: capitalize; }
.status-pending { background-color: var(--warning-color); }
.status-ordered { background-color: #17a2b8; }
.status-received { background-color: var(--success-color); }
.status-cancelled { background-color: var(--danger-color); }
/* --- Dropdown Subheader --- */
.sidebar .dropdown-content .dropdown-header { padding: 12px 15px 5px 15px; font-size: 11px; font-weight: 600; color: var(--secondary-color); text-transform: uppercase; letter-spacing: 0.5px; display: block; cursor: default; }
.sidebar .dropdown-content .dropdown-header:hover { background-color: transparent; color: var(--secondary-color); }
/* --- Dashboard Cards --- */
.dashboard-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 25px; margin-top: 20px; }
.dash-card { background-color: var(--white-color); padding: 25px; border-radius: 10px; box-shadow: var(--box-shadow); display: flex; align-items: center; gap: 20px; transition: transform 0.3s, box-shadow 0.3s; }
.dash-card:hover { transform: translateY(-5px); box-shadow: 0 8px 15px rgba(0, 0, 0, 0.07); }
.dash-card .icon { font-size: 32px; padding: 20px; border-radius: 50%; color: var(--white-color); display: flex; align-items: center; justify-content: center; width: 70px; height: 70px; }
.dash-card .info h3 { font-size: 28px; font-weight: 700; margin: 0 0 5px 0; color: var(--secondary-color); }
.dash-card .info p { margin: 0; color: var(--light-text-color); font-weight: 500; }
.dash-card.sales .icon { background-color: var(--success-color); }
.dash-card.products .icon { background-color: #17a2b8; }
.dash-card.low-stock .icon { background-color: var(--primary-color); }
.dash-card.customers .icon { background-color: #6f42c1; }

/* --- New Dashboard Styles --- */

.dashboard-main-content {
    margin-top: 30px;
    display: grid;
    grid-template-columns: 1fr;
    gap: 30px;
}

.chart-container {
    height: 400px;
}

.dashboard-lists {
    display: grid;
    grid-template-columns: 1fr;
    gap: 30px;
}

.info-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.info-list li {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 0;
    border-bottom: 1px solid var(--border-color);
}

.info-list li:last-child {
    border-bottom: none;
}

.info-list .product-name {
    font-weight: 500;
}

.info-list .product-quantity {
    font-weight: 600;
    color: var(--primary-color);
    background-color: #fceee9;
    padding: 5px 10px;
    border-radius: 6px;
    font-size: 13px;
}

.info-list .sale-info {
    display: flex;
    flex-direction: column;
}

.info-list .sale-info small {
    color: var(--light-text-color);
    font-size: 12px;
}

.info-list .sale-amount {
    color: var(--success-color);
    background-color: #eaf6ec;
}


/* --- Responsive Adjustments for Dashboard --- */
@media (min-width: 992px) {
    .dashboard-main-content {
        grid-template-columns: 2fr 1fr; /* 2/3 for chart, 1/3 for lists */
    }
}

@media (min-width: 1200px) {
    .dashboard-lists {
        display: flex;
        flex-direction: column;
    }
}
/* --- User Profile Link in Sidebar --- */
.sidebar .user-profile {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.sidebar .user-profile a {
    color: var(--secondary-color);
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px;
    border-radius: 6px;
    transition: background-color 0.3s;
}

.sidebar .user-profile a:hover {
    background-color: #f0f0f0;
    color: var(--primary-color);
}

.sidebar .user-profile a i {
    font-size: 18px;
}
.sidebar .menu {
    flex-grow: 1;
    overflow-y: auto; /* This line might already exist */
    padding: 20px 0;
}
