/* Reset and Base Styles */

*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

:root {
    --color-background: #ffffff;
    --color-foreground: #333333;
    --color-muted: #6c757d;
    --color-border: #e2e8f0;
    --color-blue: #0EA5E9;
    --color-purple: #8B5CF6;
    --color-orange: #F97316;
    --color-green: #10B981;
    --color-red: #EF4444;
    --sidebar-width: 280px;
    --sidebar-collapsed-width: 70px;
    --border-radius: 0.5rem;
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --transition: all 0.3s ease;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #f5f7fb;
    color: var(--color-foreground);
    line-height: 1.5;
    font-size: 16px;
}

h1,
h2,
h3,
h4,
h5,
h6 {
    margin-bottom: 0.5rem;
    font-weight: 600;
    line-height: 1.2;
}


/* Layout */

.dashboard-container {
    display: flex;
    height: 100vh;
    width: 100%;
}


/* Sidebar Styles */

.sidebar {
    width: var(--sidebar-width);
    background-color: var(--color-background);
    border-left: 1px solid var(--color-border);
    height: 100%;
    transition: var(--transition);
    position: fixed;
    top: 0;
    right: 0;
    z-index: 100;
    overflow-y: auto;
}

.sidebar.collapsed {
    width: var(--sidebar-collapsed-width);
}

.sidebar-header {
    padding: 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--color-border);
}

.sidebar-content {
    padding: 1rem 0;
}

.sidebar-group {
    margin-bottom: 1.5rem;
}

.sidebar-group-label {
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--color-muted);
}

.sidebar-menu-item {
    padding: 0.5rem 0;
}

.sidebar-menu-item a {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem 1rem;
    color: var(--color-foreground);
    text-decoration: none;
    transition: var(--transition);
    border-radius: 0.25rem;
}

.sidebar-menu-item a:hover {
    background-color: rgba(0, 0, 0, 0.05);
}

.sidebar-menu-item i {
    width: 20px;
    text-align: center;
}

.sidebar.collapsed .sidebar-menu-item span {
    display: none;
}


/* Main Content */

.main-content {
    flex: 1;
    padding: 1.5rem;
    transition: var(--transition);
}

.sidebar.collapsed+.main-content {
    margin-right: var(--sidebar-collapsed-width);
}


/* Dashboard Header */

.dashboard-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.action-buttons {
    display: flex;
    gap: 0.5rem;
}


/* Weight Widget */

.weight-widget {
    background-color: var(--color-background);
    border-radius: var(--border-radius);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    box-shadow: var(--shadow);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.weight-value {
    display: flex;
    flex-direction: column;
    align-items: center;
}

#currentWeight {
    font-size: 3rem;
    font-weight: bold;
    color: var(--color-green);
}

.weight-controls {
    display: flex;
    gap: 0.5rem;
}

.custom-radio-btn {
    width: 20px;
    height: 20px;
    border: 2px solid #fd0d0d;
    /* لون زي bootstrap primary */
    border-radius: 50%;
    background-color: white;
    position: relative;
    cursor: pointer;
    padding: 0;
}

.custom-radio-btn.active::after {
    content: "";
    width: 10px;
    height: 10px;
    background-color: #fd0d0d;
    border-radius: 50%;
    position: absolute;
    top: 4px;
    left: 4px;
}


/* Stats Grid */

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.stat-card {
    background-color: var(--color-background);
    border-radius: var(--border-radius);
    padding: 1.5rem;
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    box-shadow: var(--shadow);
    position: relative;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    bottom: 0;
    right: 0;
    width: 4px;
    border-radius: 0 var(--border-radius) var(--border-radius) 0;
}

.border-blue::before {
    background-color: var(--color-blue);
}

.border-purple::before {
    background-color: var(--color-purple);
}

.border-orange::before {
    background-color: var(--color-orange);
}

.border-green::before {
    background-color: var(--color-green);
}

.stat-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    color: white;
}

.blue {
    background-color: var(--color-blue);
}

.purple {
    background-color: var(--color-purple);
}

.orange {
    background-color: var(--color-orange);
}

.green {
    background-color: var(--color-green);
}

.text-dashboard-blue {
    color: var(--color-blue);
}

.text-dashboard-purple {
    color: var(--color-purple);
}

.text-dashboard-orange {
    color: var(--color-orange);
}

.text-dashboard-green {
    color: var(--color-green);
}

.stat-info {
    flex: 1;
}

.stat-value {
    font-size: 1.5rem;
    font-weight: bold;
    margin-bottom: 0.25rem;
}

.stat-description {
    font-size: 0.875rem;
    color: var(--color-muted);
}


/* Widget Container */

.widget-container {
    background-color: var(--color-background);
    border-radius: var(--border-radius);
    height: 500px;
    padding: 1.5rem;
    box-shadow: var(--shadow);
}

.widget-content,
.widget-content-empty {
    height: 100%;
    display: flex;
    flex-direction: column;
}

.widget-content-empty {
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 2rem;
}

.icon-circle {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background-color: #f3f4f6;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1rem;
}

.icon-circle i {
    font-size: 2rem;
    color: #9ca3af;
}

.empty-actions {
    display: flex;
    gap: 0.75rem;
    margin-top: 1.5rem;
}


/* Forms */

form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    /*max-width: 600px;*/
    margin: 0 auto;
    width: 80%;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

label {
    font-weight: 500;
}

input,
select,
textarea {
    padding: 0.75rem !important;
    border: 1px solid var(--color-border);
    border-radius: 0.25rem;
    font-size: 1rem;
    width: 100%
}

textarea {
    min-height: 100px;
    resize: vertical;
}

.form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
    margin-top: 1rem;
}

.weight-input-group {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.weight-checkbox {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}


/* Buttons */

.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    border-radius: 0.25rem;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    border: none;
    font-size: 0.875rem;
}

.btn i {
    font-size: 1rem;
}

.primary {
    background-color: var(--color-blue);
    color: white;
}

.primary:hover {
    background-color: #0c8fd0;
}

.secondary {
    background-color: #e5e7eb;
    color: #4b5563;
}

.secondary:hover {
    background-color: #d1d5db;
}

.outline {
    background-color: transparent;
    border: 1px solid #d1d5db;
    color: #4b5563;
}

.outline:hover {
    background-color: #f9fafb;
}

.blue {
    background-color: var(--color-blue);
    color: white;
}

.blue:hover {
    background-color: #0c8fd0;
}

.purple {
    background-color: var(--color-purple);
    color: white;
}

.purple:hover {
    background-color: #7c4df1;
}

.orange {
    background-color: var(--color-orange);
    color: white;
}

.orange:hover {
    background-color: #ea6810;
}


/* Utilities */

.hidden {
    display: none !important;
}

#weight-input {
    color: red;
    text-align: center;
    font-weight: bold;
    font-size: 1.5rem;
}

.excel {
    width: 100%;
    /* Ensure the image takes the full width of its container */
    height: auto;
    /* Maintain aspect ratio */
    max-width: 50px;
    /* Limit max width of the image */
    margin: 0 auto;
    /* Center the image inside its container */
    display: block;
    /* Make sure the image is a block-level element for centering */
}

#myRedButton {
    background-color: red;
    color: white;
    /* عشان الخط يبقى واضح */
    border: none;
    /* لو عايز تلغي حدود الزرار الافتراضية */
    padding: 10px 20px;
    /* مساحة داخلية للزرار */
    cursor: pointer;
    /* لما تحط الماوس فوقه يدي مؤشر */
    border-radius: 5px;
    /* حواف مدورة شوية */
}


/* Toast */

.toast {
    position: fixed;
    bottom: 1.5rem;
    left: 1.5rem;
    background-color: #10b981;
    color: white;
    padding: 1rem;
    border-radius: 0.25rem;
    box-shadow: var(--shadow);
    z-index: 1000;
    transition: var(--transition);
    animation: toast-in 0.3s ease-in-out;
}

.toast-content {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.toast.error {
    background-color: var(--color-red);
}


/* navbar */

.arrow-container {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    gap: 16px;
    width: 64px;
    height: 36px;
    border: 1px solid #ccc;
    /* للتوضيح فقط */
    border-radius: 6px;
    cursor: pointer;
}

.arrow {
    font-size: 20px;
    line-height: 1;
}

@keyframes toast-in {
    from {
        transform: translateY(100%);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}


/* Responsive */

@media (max-width: 991px) {
    .sidebar {
        transform: translateX(100%);
        width: var(--sidebar-width);
    }
    .sidebar.expanded {
        transform: translateX(0);
    }
    .main-content {
        margin-right: 0;
    }
    .dashboard-header {
        flex-direction: column;
        align-items: flex-start;
    }
    .weight-widget {
        flex-direction: column;
        gap: 1rem;
    }
}

@media (max-width: 768px) {
    .stats-grid {
        grid-template-columns: 1fr;
    }
    .action-buttons {
        width: 100%;
        flex-wrap: wrap;
    }
    .btn {
        width: 100%;
        justify-content: center;
    }
}

.scenario-card .card {
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    border-radius: 12px;
    background-color: #fff;
}

.scenario-card .hover-effect:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.9);
    background-color: #EF4444;
}

.scenario-card .card-title {
    font-weight: 600;
    font-size: 1.25rem;
}

.sales-type-card .hover-effect {
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    border-radius: 12px;
}

.sales-type-card .hover-effect:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.1);
}

.sales-type-card .card-title {
    font-size: 1.2rem;
    font-weight: 600;
}

.sidebar-wrapper {
    border-left: 1px solid #dee2e6;
    border-right: 1px solid #dee2e6;
    background-color: #dbcdcd;
}

.live-Weight {
    height: 100 px !important;
    line-height: 5.5 !important;
}

.card-bg-1 {
    background-image: url('/static/img/one.png');
    background-size: cover;
    background-position: center;
    color: white;
}

.card-bg-2 {
    background-image: url('/static/img/two.png');
    background-size: cover;
    background-position: center;
    color: white;
}

.custom-img {
    width: 100%;
    /* Ensure the image takes the full width of its container */
    height: auto;
    /* Maintain aspect ratio */
    max-width: 150px;
    /* Limit max width of the image */
    margin: 0 auto;
    /* Center the image inside its container */
    display: block;
    /* Make sure the image is a block-level element for centering */
}

.select2-container--bootstrap4 .select2-selection {
    height: calc(2.25rem + 2px) !important;
    padding: .375rem .75rem !important;
    font-size: 1rem;
    line-height: 1.5;
    border: 1px solid #ced4da;
    border-radius: .25rem;
}
