
:root {
    --primary-color: #4CAF50;
    --primary-dark: #43A047;
    --primary-darker: #2E7D32;
    --secondary-color: #F2F2F2;
    --text-color: #222;
    --store-name-color: #FF9800;
    --store-name-dark: rgb(241, 150, 14);
}



body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    color: var(--text-color);
    background-color: #f8f9fa;
}

/* ============================================
   Navbar Styles
   ============================================ */

.navbar {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%) !important;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    padding: 0.75rem 1rem;
}

.navbar .navbar-brand {
    color: white !important;
    transition: all 0.3s ease;
    padding: 8px 12px;
    border-radius: 6px;
}

.navbar .navbar-brand:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: translateY(-1px);
}

.navbar .nav-link {
    color: white !important;
    transition: all 0.3s ease;
    border-radius: 6px;
    margin: 0 5px;
}

.navbar .nav-link:hover {
    background: rgba(255, 255, 255, 0.1);
}

.navbar .navbar-text {
    color: white !important;
}

.navbar .store-name {
    background: linear-gradient(135deg, var(--store-name-color) 0%, var(--store-name-dark) 100%);
    backdrop-filter: blur(10px);
    border-radius: 8px;
    padding: 8px 20px;
    margin: 0 15px;
    font-size: 1.05rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
    border: 1px solid rgba(255, 255, 255, 0.3);
    box-shadow: 0 2px 8px rgba(33, 150, 243, 0.3);
    transition: all 0.3s ease;
}

.navbar .store-name:hover {
    background: linear-gradient(135deg, var(--store-name-dark) 0%, var(--store-name-color) 100%);
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(33, 150, 243, 0.4);
}

.navbar .store-name i {
    font-size: 1.2rem;
    color: #fff;
    filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.2));
}

.navbar .store-name strong {
    color: #fff;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
    letter-spacing: 0.5px;
}

@media (max-width: 991px) {
    .navbar .store-name {
        margin: 10px 0;
        width: 100%;
        justify-content: center;
    }
}

/* ============================================
   Button Styles
   ============================================ */

.btn-primary {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
}

.btn-primary:hover {
    background-color: var(--primary-dark);
    border-color: var(--primary-dark);
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed !important;
    pointer-events: none;
}

/* Highlight style for Add Store button */
.add-store-btn,
.stores-header .btn-primary:not(:disabled),
.empty-stores .btn-primary:not(:disabled) {
    background: linear-gradient(135deg, #4CAF50 0%, #43A047 100%) !important;
    border: 2px solid #4CAF50 !important;
    box-shadow: 0 4px 15px rgba(76, 175, 80, 0.4), 0 0 20px rgba(76, 175, 80, 0.2) !important;
    animation: pulse-glow 2s ease-in-out infinite;
    font-weight: 600;
    padding: 0.75rem 1.5rem;
    transition: all 0.3s ease;
}

.add-store-btn:hover,
.stores-header .btn-primary:hover:not(:disabled),
.empty-stores .btn-primary:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(76, 175, 80, 0.5), 0 0 30px rgba(76, 175, 80, 0.3) !important;
    background: linear-gradient(135deg, #43A047 0%, #388E3C 100%) !important;
}

@keyframes pulse-glow {
    0%, 100% {
        box-shadow: 0 4px 15px rgba(76, 175, 80, 0.4), 0 0 20px rgba(76, 175, 80, 0.2);
    }
    50% {
        box-shadow: 0 4px 20px rgba(76, 175, 80, 0.6), 0 0 30px rgba(76, 175, 80, 0.4);
    }
}

/* ============================================
   Card Styles
   ============================================ */

.card {
    border: none;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.card-header {
    background-color: var(--primary-color);
    color: white;
    font-weight: bold;
}

/* ============================================
   Sidebar Styles
   ============================================ */

.sidebar {
    background-color: white;
    min-height: calc(100vh - 56px);
    box-shadow: 2px 0 4px rgba(0,0,0,0.1);
    transition: transform 0.3s ease;
}

.sidebar-overlay {
    display: none;
    position: fixed;
    top: 56px;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1040;
    transition: opacity 0.3s ease;
}

.sidebar-overlay.show {
    display: block;
    opacity: 1;
}

@media (max-width: 991px) {
    .sidebar {
        position: fixed;
        top: 56px;
        right: 0;
        width: 280px;
        max-width: 85%;
        height: calc(100vh - 56px);
        z-index: 1050;
        transform: translateX(100%);
        overflow-y: auto;
        transition: transform 0.3s ease;
    }
    
    .sidebar.show {
        transform: translateX(0);
    }
    
    .main-content {
        width: 100%;
        margin-left: 0;
    }
    
    .navbar-toggler {
        padding: 0.5rem 0.75rem;
    }
}

.sidebar .nav-link {
    color: var(--text-color) !important;
    padding: 12px 20px;
    border-radius: 5px;
    margin: 5px 10px;
}

.sidebar .nav-link:hover,
.sidebar .nav-link.active {
    background-color: var(--secondary-color);
    color: var(--primary-darker) !important;
}

.sidebar .nav-link i {
    color: var(--text-color);
    margin-left: 8px;
}

.main-content {
    padding: 20px;
}

/* ============================================
   Stat Card Styles
   ============================================ */

.stat-card {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    color: white;
    border-radius: 10px;
    padding: 20px;
    margin-bottom: 20px;
}

.stat-card h3 {
    font-size: 2rem;
    font-weight: bold;
}

/* ============================================
   Store Name Badge Styles
   ============================================ */

.sidebar-store-name {
    padding: 15px;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-bottom: 2px solid #4CAF50;
}

.store-name-badge {
    background: linear-gradient(135deg, var(--store-name-color) 0%, var(--store-name-dark) 100%);
    color: white;
    padding: 12px 16px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    gap: 10px;
    box-shadow: 0 2px 8px rgba(255, 152, 0, 0.25);
    transition: all 0.3s ease;
}

.store-name-badge:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(255, 152, 0, 0.35);
}

.store-name-badge i {
    font-size: 1.3rem;
    flex-shrink: 0;
}

.store-name-text {
    font-weight: 600;
    font-size: 0.95rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    flex: 1;
}

@media (max-width: 991px) {
    .sidebar-store-name {
        padding: 12px;
    }
    
    .store-name-badge {
        padding: 10px 14px;
    }
    
    .store-name-text {
        font-size: 0.875rem;
    }
}

@media (max-width: 576px) {
    .store-name-badge {
        flex-direction: column;
        text-align: center;
        gap: 5px;
    }
    
    .store-name-text {
        white-space: normal;
        word-break: break-word;
    }
}

/* ============================================
   Stores Page Styles
   ============================================ */

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

.stores-header h2 {
    margin: 0;
    font-weight: 700;
    color: var(--primary-darker);
}

.store-card {
    transition: all 0.3s ease;
    border: none;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    height: 100%;
    border-radius: 12px;
    overflow: hidden;
}

.store-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
}

.store-card .card-header {
    /* Background color is set inline using store theme color */
    padding: 1.25rem;
    border: none;
}

.store-card .card-header h5 {
    margin: 0;
    font-weight: 600;
    font-size: 1.25rem;
    display: flex;
    align-items: center;
    gap: 10px;
}

.store-card .card-body {
    padding: 1.5rem;
}

.store-info {
    margin-bottom: 1rem;
}

.store-info-item {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin-bottom: 0.75rem;
    color: #555;
    font-size: 0.95rem;
}

.store-info-item i {
    color: var(--primary-color);
    margin-top: 3px;
    flex-shrink: 0;
}

.store-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 1.5rem;
    padding-top: 1rem;
    border-top: 1px solid #eee;
}

.store-actions .btn {
    flex: 1;
    min-width: 100px;
    font-size: 0.875rem;
    padding: 0.5rem 1rem;
}

.current-store-badge {
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.875rem;
    box-shadow: 0 2px 6px rgba(40, 167, 69, 0.3);
}

.empty-stores {
    text-align: center;
    padding: 3rem 1rem;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-radius: 12px;
    margin-top: 2rem;
}

.empty-stores i {
    font-size: 4rem;
    color: var(--primary-color);
    margin-bottom: 1rem;
}

@media (max-width: 768px) {
    .stores-header {
        flex-direction: column;
        align-items: stretch;
    }
    
    .stores-header h2 {
        text-align: center;
    }
    
    .stores-header .btn {
        width: 100%;
    }
    
    .store-card {
        margin-bottom: 1.5rem;
    }
    
    .store-actions {
        flex-direction: column;
    }
    
    .store-actions .btn {
        width: 100%;
    }
}

@media (max-width: 576px) {
    .store-card .card-body {
        padding: 1rem;
    }
    
    .store-info-item {
        font-size: 0.875rem;
    }
}

/* ============================================
   Products Page Styles
   ============================================ */

.products-table {
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.products-table thead {
    background: linear-gradient(135deg, #4CAF50 0%, #43A047 100%);
    color: white;
}

.products-table thead th {
    border: none;
    padding: 15px 12px;
    font-weight: 600;
    font-size: 0.95rem;
}

.products-table tbody tr {
    transition: all 0.2s ease;
    border-bottom: 1px solid #e9ecef;
}

.products-table tbody tr:hover {
    background-color: #f8f9fa;
    transform: scale(1.001);
}

.products-table tbody td {
    padding: 15px 12px;
    vertical-align: middle;
}

.product-image {
    width: 60px;
    height: 60px;
    object-fit: cover;
    border-radius: 8px;
    border: 2px solid #e9ecef;
    transition: all 0.2s ease;
}

.product-image:hover {
    border-color: #4CAF50;
    transform: scale(1.05);
}

.product-image-placeholder {
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, #e9ecef 0%, #dee2e6 100%);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #6c757d;
    font-size: 1.5rem;
}

.product-name {
    font-weight: 600;
    color: #333;
    font-size: 1rem;
}

.product-sku {
    color: #6c757d;
    font-size: 0.875rem;
    font-family: 'Courier New', monospace;
}

.price-cell {
    font-weight: 600;
    color: #2E7D32;
}

.cost-price {
    color: #666;
    font-size: 0.9rem;
}

.selling-price {
    color: #4CAF50;
    font-size: 1rem;
}

.original-price {
    text-decoration: line-through;
    color: #999;
    font-size: 0.85rem;
    display: block;
}

.discounted-price {
    color: #4CAF50;
    font-weight: 600;
    font-size: 1rem;
    display: block;
}

.action-buttons {
    display: flex;
    gap: 5px;
    flex-wrap: wrap;
}

.action-buttons .btn {
    padding: 6px 10px;
    border-radius: 6px;
    transition: all 0.2s ease;
}

.action-buttons .btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.badge {
    padding: 6px 12px;
    font-size: 0.85rem;
    font-weight: 600;
}

.pagination-info {
    color: #6c757d;
    font-size: 0.9rem;
    margin-top: 10px;
}

/* Pagination Styles */
.pagination {
    margin: 0;
    padding: 0;
    list-style: none;
    display: flex;
    gap: 5px;
    flex-wrap: wrap;
    align-items: center;
}

.pagination .page-item {
    margin: 0;
}

.pagination .page-link {
    padding: 8px 14px;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    color: #4CAF50;
    text-decoration: none;
    background-color: #fff;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 0.9rem;
    line-height: 1.5;
    min-height: 38px;
    white-space: nowrap;
}

.pagination .page-link:hover:not(.disabled) {
    background-color: #4CAF50;
    color: white;
    border-color: #4CAF50;
    transform: translateY(-2px);
}

.pagination .page-item.active .page-link {
    background-color: #4CAF50;
    border-color: #4CAF50;
    color: white;
    font-weight: 600;
}

.pagination .page-item.disabled .page-link {
    color: #6c757d;
    pointer-events: none;
    background-color: #e9ecef;
    border-color: #dee2e6;
    opacity: 0.6;
    cursor: not-allowed;
}

.pagination .page-link .bi {
    font-size: 0.9rem !important;
    width: 1em !important;
    height: 1em !important;
    display: inline-block;
    vertical-align: middle;
}

/* ============================================
   Product Show Page Styles
   ============================================ */

.carousel-control-prev,
.carousel-control-next {
    background-color: rgba(0, 0, 0, 0.3);
    width: 50px;
    height: 50px;
    border-radius: 50%;
    top: 50%;
    transform: translateY(-50%);
}

.carousel-control-prev {
    right: 10px;
}

.carousel-control-next {
    left: 10px;
}

.carousel-indicators {
    margin-bottom: -30px;
}

.carousel-indicators button {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background-color: rgba(255, 255, 255, 0.5);
    border: 2px solid rgba(255, 255, 255, 0.8);
}

.carousel-indicators button.active {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
}

.img-thumbnail.cursor-pointer:hover {
    opacity: 0.8;
    border-color: var(--primary-color) !important;
}

/* ============================================
   Admin Users Create Page Styles
   ============================================ */

.store-item-card {
    cursor: pointer;
}

.store-card-item {
    border: 2px solid #e9ecef;
    transition: all 0.2s ease;
    background-color: #fff;
}

.store-card-item:hover {
    border-color: #4CAF50;
    box-shadow: 0 2px 8px rgba(76, 175, 80, 0.15);
    transform: translateY(-2px);
}

.store-card-item.active {
    border-color: #4CAF50;
    background-color: #f0f9f0;
}

.store-card-item.active .store-icon {
    display: none;
}

.store-card-item.active .selected-icon {
    display: inline-block !important;
}

.store-card-item.active .store-name {
    color: #2E7D32;
    font-weight: 600;
}

.store-name {
    color: #333;
    transition: color 0.2s ease;
}

.store-icon {
    transition: all 0.2s ease;
}

.selected-icon {
    transition: all 0.2s ease;
}

/* ============================================
   Admin Users Assign Stores Page Styles
   ============================================ */

.store-item {
    transition: transform 0.2s ease;
}

.store-checkbox-wrapper {
    border: 2px solid #e9ecef;
    transition: all 0.3s ease;
}

.store-checkbox-wrapper:hover {
    border-color: #0d6efd;
    background-color: #f0f7ff !important;
    box-shadow: 0 2px 8px rgba(13, 110, 253, 0.15);
}

@media (min-width: 768px) {
    .store-checkbox-wrapper:hover {
        transform: translateX(5px);
    }
}

.store-checkbox-wrapper.bg-light-success {
    background-color: #d1e7dd !important;
    border-color: #198754;
}

.store-checkbox:checked ~ label .store-name {
    color: #0d6efd !important;
}

.store-checkbox:checked ~ label .store-checkbox-wrapper {
    border-color: #0d6efd;
}

.store-item.hidden {
    display: none;
}

.store-checkbox {
    flex-shrink: 0;
    min-width: 22px;
}

@media (max-width: 767px) {
    .store-checkbox {
        width: 24px !important;
        height: 24px !important;
        min-width: 24px !important;
    }
    
    .store-name {
        font-size: 0.95rem !important;
    }
    
    .store-checkbox-wrapper {
        padding: 1rem !important;
    }
    
    .store-checkbox-wrapper .d-flex {
        gap: 0.75rem;
    }
}

@media (max-width: 575px) {
    .store-checkbox {
        width: 26px !important;
        height: 26px !important;
        min-width: 26px !important;
    }
    
    .store-checkbox-wrapper {
        padding: 0.75rem !important;
    }
}

#storesList::-webkit-scrollbar {
    width: 10px;
}

#storesList::-webkit-scrollbar-track {
    background: #f1f3f5;
    border-radius: 10px;
}

#storesList::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, #0d6efd 0%, #0a58ca 100%);
    border-radius: 10px;
}

#storesList::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(180deg, #0a58ca 0%, #084298 100%);
}

/* ============================================
   Products Table Responsive Styles
   ============================================ */

.pagination .page-link i,
.pagination .page-link svg {
    font-size: 0.9rem !important;
    max-width: 16px !important;
    max-height: 16px !important;
    display: inline-block;
}

@media (max-width: 768px) {
    .products-table {
        font-size: 0.875rem;
    }
    
    .products-table thead th,
    .products-table tbody td {
        padding: 10px 8px;
    }
    
    .action-buttons {
        flex-direction: column;
    }
    
    .action-buttons .btn {
        width: 100%;
    }
}

/* ============================================
   Products Table Responsive Styles
   ============================================ */

@media (max-width: 768px) {
    .products-table {
        font-size: 0.875rem;
    }
    
    .products-table thead th,
    .products-table tbody td {
        padding: 10px 8px;
    }
    
    .action-buttons {
        flex-direction: column;
    }
    
    .action-buttons .btn {
        width: 100%;
    }
}

/* ============================================
   Admin Users Styles
   ============================================ */

.bg-light-success {
    background-color: #d1e7dd !important;
}

.selected-store-item {
    padding: 10px;
    margin-bottom: 8px;
    background: #f8f9fa;
    border-radius: 6px;
    border-right: 3px solid #198754;
    transition: all 0.2s ease;
}

.selected-store-item:hover {
    background: #e9ecef;
    transform: translateX(-3px);
}

/* ============================================
   Product Select - Create New Option Styles
   ============================================ */

/* Style the "Create New Product" option */
.product-select option[value="__NEW__"],
.product-select option.new-product-option {
    background-color: var(--store-name-color) !important;
    color: #ffffff !important;
    font-weight: 500 !important;
    font-size: 1.05em !important;
    padding: 10px 12px !important;
    border-top: 2px solid var(--store-name-dark) !important;
}

/* Style when selected/hovered */
.product-select option[value="__NEW__"]:checked,
.product-select option.new-product-option:checked,
.product-select option[value="__NEW__"]:hover,
.product-select option.new-product-option:hover {
    background-color: var(--store-name-dark) !important;
    background: linear-gradient(135deg, var(--store-name-dark) 0%, var(--store-name-color) 100%) !important;
    color: white !important;
}

/* Add a visual indicator to the select when it contains the new product option */
.product-select:has(option[value="__NEW__"]) {
    border-left: 3px solid var(--store-name-color);
    transition: all 0.3s ease;
}

.product-select:has(option[value="__NEW__"]):focus {
    border-color: var(--store-name-color);
    box-shadow: 0 0 0 0.25rem rgba(255, 152, 0, 0.25);
}
