/* Custom CSS for Grostore POS UI */

/* Root Variables */
:root {
    --primary-green: #5cb85c;
    --success-green: #28a745;
    --warning-orange: #ff8c00;
    --danger-red: #dc3545;
    --light-gray: #f8f9fa;
    --dark-gray: #6c757d;
}

/* General Styles */
body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    overflow-x: hidden;
    position: relative;
}

.cursor-pointer {
    cursor: pointer;
}

/* Sidebar Menu Styles */
.sidebar-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1040;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.sidebar-overlay.active {
    opacity: 1;
    visibility: visible;
}

.sidebar-menu {
    position: fixed;
    top: 0;
    left: -300px;
    width: 300px;
    height: 100%;
    background: white;
    box-shadow: 2px 0 15px rgba(0, 0, 0, 0.1);
    z-index: 1050;
    transition: left 0.3s ease;
    overflow-y: auto;
}

.sidebar-menu.active {
    left: 0;
}

.sidebar-header {
    padding: 1.5rem;
    border-bottom: 1px solid #e9ecef;
    background: linear-gradient(135deg, var(--success-green) 0%, #20a038 100%);
    color: white;
}

.sidebar-header .logo-icon {
    font-size: 1.5rem;
}

.sidebar-header h5 {
    color: white;
}

.sidebar-header .btn-link {
    color: white !important;
}

.sidebar-body {
    padding: 1rem 0;
}

.sidebar-nav {
    list-style: none;
    padding: 0;
    margin: 0;
}

.sidebar-nav-item {
    display: flex;
    align-items: center;
    padding: 0.875rem 1.5rem;
    color: #495057;
    text-decoration: none;
    transition: all 0.3s ease;
    border-left: 3px solid transparent;
}

.sidebar-nav-item:hover {
    background-color: #f8f9fa;
    color: var(--success-green);
    border-left-color: var(--success-green);
}

.sidebar-nav-item.active {
    background-color: #e6fff0;
    color: var(--success-green);
    border-left-color: var(--success-green);
    font-weight: 600;
}

.sidebar-nav-item i {
    font-size: 1.25rem;
    width: 30px;
    margin-right: 0.75rem;
    text-align: center;
}

.sidebar-nav-item span {
    flex: 1;
}

.sidebar-nav-item.text-danger:hover {
    background-color: #ffebee;
    color: #dc3545 !important;
    border-left-color: #dc3545;
}

.sidebar-section-title {
    padding: 0.5rem 1.5rem;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    color: #6c757d;
    letter-spacing: 0.5px;
}

/* Sidebar Toggle Button */
#sidebarToggle {
    transition: transform 0.3s ease;
}

#sidebarToggle:hover {
    transform: rotate(90deg);
}

/* Logo Styles */
.logo-icon {
    font-size: 2rem;
    display: inline-block;
}

.logo-container {
    gap: 0.5rem;
}

/* User Avatar Styles */
.user-avatar-btn {
    background: none;
    transition: transform 0.3s ease;
}

.user-avatar-btn:hover {
    transform: scale(1.05);
}

.user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    overflow: hidden;
    border: 2px solid var(--success-green);
    box-shadow: 0 2px 8px rgba(40, 167, 69, 0.2);
    transition: all 0.3s ease;
}

.user-avatar:hover {
    border-color: var(--primary-green);
    box-shadow: 0 4px 12px rgba(40, 167, 69, 0.3);
}

.user-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.dropdown-menu {
    border-radius: 10px;
    border: 1px solid #e9ecef;
    min-width: 250px;
    padding: 0.5rem 0;
    margin-top: 0.5rem !important;
}

.dropdown-item {
    padding: 0.6rem 1rem;
    transition: all 0.2s ease;
    font-size: 0.9rem;
}

.dropdown-item:hover {
    background-color: #f8f9fa;
    padding-left: 1.25rem;
}

.dropdown-item i {
    width: 20px;
}

/* Login Page Styles */
.vh-100 {
    min-height: 100vh;
}

.card {
    transition: all 0.3s ease;
}

.card:hover {
    transform: translateY(-2px);
}

.input-group-text {
    border-right: none;
}

.form-control:focus {
    border-color: var(--success-green);
    box-shadow: 0 0 0 0.2rem rgba(40, 167, 69, 0.25);
}

/* Category Card Styles */
.category-card {
    transition: all 0.3s ease;
    cursor: pointer;
    border: 2px solid transparent;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    min-height: 140px;
}

.category-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.category-card.active {
    border-color: var(--success-green);
    background-color: rgba(40, 167, 69, 0.1) !important;
    box-shadow: 0 4px 12px rgba(40, 167, 69, 0.3);
    transform: translateY(-3px);
}

.category-icon {
    font-size: 2.5rem;
    line-height: 1;
}

/* Category Tabs Styles */
#categoryTabs .nav-link {
    color: var(--dark-gray);
    background-color: transparent;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    padding: 0.6rem 1.5rem;
    font-weight: 500;
    transition: all 0.3s ease;
    margin-right: 0.5rem;
}

#categoryTabs .nav-link:hover {
    background-color: #f8f9fa;
    border-color: var(--success-green);
    color: var(--success-green);
    transform: translateY(-2px);
}

#categoryTabs .nav-link.active {
    background-color: var(--success-green);
    border-color: var(--success-green);
    color: white;
    box-shadow: 0 4px 12px rgba(40, 167, 69, 0.3);
}

/* Swiper Category Carousel Styles */
.categorySwiper {
    padding: 10px 30px;
}

.categorySwiper .swiper-slide {
    width: 160px;
    height: auto;
}

.swiper-button-prev-custom,
.swiper-button-next-custom {
    border: none;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.swiper-button-prev-custom:hover,
.swiper-button-next-custom:hover {
    transform: translateY(-50%) scale(1.1);
    transition: all 0.3s ease;
}

/* Category Background Colors */
.bg-light-pink {
    background-color: #ffe4e6;
}

.bg-light-yellow {
    background-color: #fff4e6;
}

.bg-light-green {
    background-color: #e6ffe6;
}

.bg-light-blue {
    background-color: #e6f3ff;
}

/* Product Card Styles */
.product-card {
    padding: 1rem;
    border-radius: 0.5rem;
    border: 1px solid #e9ecef;
    transition: all 0.3s ease;
    background-color: white;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.product-card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    transform: translateY(-3px);
    border-color: var(--success-green);
}

.product-image {
    display: flex;
    align-items: flex-start;
    justify-content: center;
    flex-shrink: 0;
}

.product-name {
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    line-height: 1.3;
}

.product-price {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.5rem;
    flex-wrap: wrap;
}

/* Billing Section Styles */
.billing-section {
    max-height: calc(100vh - 100px);
    overflow-y: auto;
}

.cart-section {
    background-color: #f8f9fa;
    padding: 0.5rem;
    border-radius: 0.5rem;
}

.table-sm th,
.table-sm td {
    padding: 0.5rem 0.25rem;
}

/* Button Styles */
.btn-success {
    background-color: var(--success-green);
    border-color: var(--success-green);
}

.btn-success:hover {
    background-color: #218838;
    border-color: #1e7e34;
}

.btn-warning {
    background-color: var(--warning-orange);
    border-color: var(--warning-orange);
    color: white;
}

.btn-warning:hover {
    background-color: #e67e00;
    border-color: #d97600;
    color: white;
}

/* Input Group Styles */
.input-group-text {
    background-color: transparent;
}

/* Sticky Header */
.sticky-top {
    position: sticky;
    top: 0;
    z-index: 1020;
}

/* Search Input Focus */
#searchInput:focus,
#itemCodeInput:focus {
    border-color: var(--success-green);
    box-shadow: 0 0 0 0.2rem rgba(40, 167, 69, 0.25);
}

/* Checkout Page Styles */

/* Checkout Steps Progress */
.checkout-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
}

.step-circle {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background-color: #e9ecef;
    color: #6c757d;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 1.2rem;
    margin-bottom: 0.5rem;
    transition: all 0.3s ease;
}

.checkout-step.active .step-circle {
    background-color: var(--success-green);
    color: white;
}

.step-label {
    font-size: 0.9rem;
    color: #6c757d;
}

.checkout-step.active .step-label {
    color: var(--success-green);
    font-weight: 600;
}

.step-line {
    width: 120px;
    height: 2px;
    background-color: #e9ecef;
    margin: 0 1rem;
    margin-bottom: 30px;
}

.checkout-step.active~.step-line {
    background-color: var(--success-green);
}

/* Payment Option Styles */
.payment-option {
    transition: all 0.3s ease;
}

.payment-option:hover {
    border-color: var(--success-green) !important;
    background-color: #f0fff4;
}

.payment-option.active {
    border-color: var(--success-green) !important;
    background-color: #e6fff0;
}

.form-check-input:checked {
    background-color: var(--success-green);
    border-color: var(--success-green);
}

/* Order Items Scrollbar */
.order-items::-webkit-scrollbar {
    width: 6px;
}

.order-items::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 10px;
}

.order-items::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 10px;
}

.order-items::-webkit-scrollbar-thumb:hover {
    background: #555;
}

/* Card Hover Effects */
.card {
    transition: all 0.3s ease;
}

/* Responsive Styles */
@media (max-width: 768px) {
    .category-card {
        padding: 0.75rem !important;
    }

    .category-icon {
        font-size: 2rem;
    }

    .product-card {
        padding: 0.75rem;
    }

    .billing-section {
        position: relative !important;
        top: 0 !important;
        margin-top: 1rem;
    }

    .step-line {
        width: 60px;
    }

    .step-label {
        font-size: 0.75rem;
    }

    .step-circle {
        width: 40px;
        height: 40px;
        font-size: 1rem;
    }
}

@media (max-width: 576px) {
    .logo-icon {
        font-size: 1.5rem;
    }

    h4 {
        font-size: 1.25rem;
    }

    .product-image span {
        font-size: 2rem !important;
    }
}

/* Dark Mode Toggle (Optional) */
body.dark-mode {
    background-color: #1a1a1a;
    color: #e0e0e0;
}

body.dark-mode .bg-white {
    background-color: #2d2d2d !important;
}

body.dark-mode .card {
    background-color: #2d2d2d;
    border-color: #404040;
}

body.dark-mode .text-dark {
    color: #e0e0e0 !important;
}

body.dark-mode .product-card,
body.dark-mode .category-card {
    background-color: #2d2d2d;
    border-color: #404040;
}

/* Animation */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in {
    animation: fadeIn 0.5s ease-in;
}

/* Utility Classes */
.shadow-sm-hover:hover {
    box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075) !important;
}

.rounded-4 {
    border-radius: 1rem !important;
}

/* Table Styles */
.table-light {
    background-color: #f8f9fa;
}

.sticky-top {
    position: sticky;
    top: 0;
    z-index: 10;
}

/* Scrollbar Styles for Cart Section */
.cart-section .table-responsive::-webkit-scrollbar {
    width: 6px;
}

.cart-section .table-responsive::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 10px;
}

.cart-section .table-responsive::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 10px;
}

.cart-section .table-responsive::-webkit-scrollbar-thumb:hover {
    background: #555;
}

/* Quantity Input Styles */
.btn-group-sm .form-control {
    padding: 0.25rem 0.5rem;
    font-size: 0.875rem;
}

/* Price Display */
.text-danger {
    color: #ff6b6b !important;
}

/* Footer Styles */
footer {
    margin-top: auto;
}

/* Loading State */
.loading {
    opacity: 0.6;
    pointer-events: none;
}

/* Success Message */
.alert-success {
    background-color: #d4edda;
    border-color: #c3e6cb;
    color: #155724;
}

/* SweetAlert2 Custom Styles */
.swal2-popup {
    font-size: 0.9rem !important;
    border-radius: 12px !important;
}

.swal2-popup.small-alert {
    padding: 0.8rem !important;
    font-size: 0.85rem !important;
}

.swal2-title {
    font-size: 1.2rem !important;
    color: var(--dark-gray);
}

.swal2-html-container {
    font-size: 0.9rem !important;
}

.swal2-confirm {
    border-radius: 8px !important;
    padding: 0.5rem 1.5rem !important;
    font-weight: 500 !important;
}

.swal2-cancel {
    border-radius: 8px !important;
    padding: 0.5rem 1.5rem !important;
    font-weight: 500 !important;
}

.swal2-toast {
    border-radius: 10px !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15) !important;
}

.swal2-toast .swal2-title {
    font-size: 0.9rem !important;
    font-weight: 500 !important;
    margin: 0 !important;
}

.swal2-toast .swal2-icon {
    width: 1.5rem !important;
    height: 1.5rem !important;
    margin: 0 0.5rem 0 0 !important;
}

.swal2-timer-progress-bar {
    background: var(--success-green) !important;
}

/* Error Message */
.alert-danger {
    background-color: #f8d7da;
    border-color: #f5c6cb;
    color: #721c24;
}

/* Custom Scrollbar for Webkit Browsers */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #555;
}

/* Responsive Width Utility */
@media (min-width: 768px) {
    .w-md-auto {
        width: auto !important;
    }
}