:root {
    --primary-color: #0B8F3D;
    --primary-light: #28a745;
    --secondary-color: #20c997;
    --bg-color: #f0fdf4;
    --glass-bg: rgba(255, 255, 255, 0.55);
    --glass-border: rgba(255, 255, 255, 0.8);
    --glass-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.05);
}

body {
    background-color: var(--bg-color);
    font-family: 'Inter', sans-serif;
    color: #333;
    min-height: 100vh;
    overflow-x: hidden;
    position: relative;
}

/* Background animated blobs for true glassmorphism feel */
.bg-blobs {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    overflow: hidden;
    z-index: -1;
    pointer-events: none;
}
.blob {
    position: absolute;
    filter: blur(80px);
    z-index: -1;
    opacity: 0.7;
    pointer-events: none;
    animation: float 20s infinite ease-in-out alternate;
}
.blob-1 {
    top: -10%; left: -10%;
    width: 50vw; height: 50vw;
    background: #d1fae5;
}
.blob-2 {
    bottom: -10%; right: -10%;
    width: 60vw; height: 60vw;
    background: #bbf7d0;
    animation-delay: -5s;
}
.blob-3 {
    top: 40%; left: 30%;
    width: 40vw; height: 40vw;
    background: #e0f2fe; /* Light blue accent */
    animation-delay: -10s;
}

@keyframes float {
    0% { transform: translate(0, 0) scale(1); }
    100% { transform: translate(50px, 50px) scale(1.1); }
}

/* Glassmorphism Classes */
.glass-card {
    background: var(--glass-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    box-shadow: var(--glass-shadow);
    transition: box-shadow 0.3s ease;
}

.glass-card:hover {
    box-shadow: 0 12px 40px 0 rgba(0, 100, 0, 0.1);
}

/* Sidebar Layout */
#wrapper {
    overflow-x: hidden;
}

#sidebar-wrapper {
    min-height: 100vh;
    width: 260px;
    background: linear-gradient(135deg, var(--primary-light), var(--primary-color)) !important;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-right: none;
    transition: margin 0.25s ease-out;
    box-shadow: 4px 0 24px rgba(0,0,0,0.1);
}

#sidebar-wrapper .sidebar-heading {
    padding: 1.5rem 1.25rem;
}

#sidebar-wrapper .list-group {
    width: 260px;
}

#sidebar-wrapper .list-group-item {
    border: none;
    padding: 1rem 1.5rem;
    transition: all 0.2s;
    color: rgba(255, 255, 255, 0.9) !important;
}

#sidebar-wrapper .list-group-item:hover,
#sidebar-wrapper .list-group-item.active {
    background: rgba(255, 255, 255, 0.2) !important;
    color: #fff !important;
    font-weight: 600;
    border-radius: 12px;
    margin: 0 10px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.03);
}

/* Submenu adjustment */
#categoriesSubmenu .list-group-item {
    padding: 0.8rem 1.5rem;
    font-size: 0.95rem;
}

#page-content-wrapper {
    min-width: 100vw;
}

/* Sidebar Toggle for Mobile */
@media (max-width: 768px) {
    #sidebar-wrapper {
        margin-left: -260px;
        position: fixed;
        z-index: 1000;
        height: 100%;
    }
    #wrapper.toggled #sidebar-wrapper {
        margin-left: 0;
    }
}

@media (min-width: 768px) {
    #page-content-wrapper {
        min-width: 0;
        width: 100%;
    }
}

/* Typography and Colors */
.text-primary-custom {
    color: var(--primary-color) !important;
}

.btn-primary-custom {
    background: linear-gradient(135deg, var(--primary-light), var(--primary-color));
    border: none;
    color: white;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(11, 143, 61, 0.2);
}

.btn-primary-custom:hover {
    background: linear-gradient(135deg, #2fd254, var(--primary-light));
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(11, 143, 61, 0.3);
    color: white;
}

.btn-outline-success {
    color: var(--primary-color);
    border-color: var(--primary-color);
    background: rgba(255,255,255,0.5);
    backdrop-filter: blur(5px);
}
.btn-outline-success:hover, .btn-check:checked + .btn-outline-success {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
    color: white;
}

/* Dashboard Cards */
.stat-card {
    position: relative;
    overflow: hidden;
}

.stat-icon {
    font-size: 2.5rem;
    color: var(--secondary-color);
    opacity: 0.8;
}

.grand-total-card {
    background: linear-gradient(135deg, var(--primary-light), var(--primary-color)) !important;
    color: white !important;
    border: none;
    box-shadow: 0 8px 25px rgba(11, 143, 61, 0.3);
}

.grand-total-card .text-muted {
    color: rgba(255,255,255,0.8) !important;
}

/* Form Styling */
.form-control, .form-select {
    border-radius: 12px;
    border: 1px solid var(--glass-border);
    background: rgba(255,255,255,0.8);
    padding: 0.8rem 1.2rem;
    transition: all 0.3s ease;
}

.form-control:focus, .form-select:focus {
    background: #fff;
    border-color: var(--secondary-color);
    box-shadow: 0 0 0 0.25rem rgba(32, 201, 151, 0.25);
}

/* Table Styling */
.table {
    background: transparent;
}
.table-hover tbody tr:hover {
    background-color: rgba(255, 255, 255, 0.5);
    transition: background-color 0.2s ease;
}
.table th {
    font-weight: 600;
    color: #444;
    border-bottom: 2px solid rgba(0,0,0,0.05);
    background: rgba(255,255,255,0.4) !important;
    backdrop-filter: blur(5px);
}
.table td {
    border-bottom: 1px solid rgba(0,0,0,0.05);
}

/* Arabic Text Formatting */
.arabic-text {
    font-family: 'Cairo', sans-serif;
    direction: rtl;
    letter-spacing: 0.5px;
}

/* Animations */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.glass-card, .sidebar {
    animation: fadeIn 0.5s ease-out forwards;
}

/* Print Styles */
@media print {
    body * {
        visibility: hidden;
    }
    #receiptModal .modal-content, #receiptModal .modal-content * {
        visibility: visible;
    }
    #receiptModal .modal-content {
        position: absolute;
        left: 0;
        top: 0;
        width: 100%;
        border: none;
        box-shadow: none;
    }
    .modal-footer {
        display: none !important;
    }
}
