/* Shop Page Styling */

body {
    background-color: #111827;
    color: white;
}

.main-content {
    background-color: #111827;
    min-height: 100vh;
    position: relative;
    padding-top: 10px;
}

/* Particle animation styles */
@keyframes fall {
    to {
        transform: translateY(100vh);
    }
}



.opacity-75 {
    opacity: 0.75;
}

/* Card Styling */
.card {
    background: #1f2937 !important;
    border: 1px solid #374151 !important;
    color: white;
}

.card-header {
    background: #374151 !important;
    border-bottom: 1px solid #4b5563 !important;
    color: white;
}

.card-body {
    background: #1f2937 !important;
    color: white;
    padding: 1rem !important;
}

/* Mobile card body padding */
@media (max-width: 768px) {
    .card-body {
        padding: 0.75rem !important;
    }
    
    .card.mb-3 {
        margin-bottom: 1rem !important;
    }
}

/* Form Styling */
.form-control, .form-select {
    background-color: #374151 !important;
    border: 1px solid #4b5563 !important;
    color: white !important;
    border-radius: 8px;
}

/* Mobile search input group styling */
@media (max-width: 768px) {
    .input-group .form-control:last-child {
        border-radius: 6px 0 0 6px;
    }
}

.form-control:focus, .form-select:focus {
    background-color: #374151 !important;
    border-color: #f59e0b !important;
    color: white !important;
    box-shadow: 0 0 0 0.2rem rgba(245, 158, 11, 0.25) !important;
}

.form-control::placeholder {
    color: #9ca3af;
}

.input-group-text {
    background: #4b5563 !important;
    border: 1px solid #4b5563 !important;
    color: #f3f4f6;
}

/* Mobile input group text styling */
@media (max-width: 768px) {
    .input-group .input-group-text:first-child {
        border-radius: 6px 0 0 6px;
    }
    
    /* Reduce input group padding on mobile */
    .input-group-text {
        padding: 0.375rem 0.5rem !important;
        font-size: 0.875rem !important;
    }
    
    .form-control {
        padding: 0.375rem 0.5rem !important;
        font-size: 0.875rem !important;
    }
}

/* Button Styling */
.btn {
    transition: all 0.3s ease;
    border-radius: 8px;
    font-weight: 500;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.3);
}

.btn-primary {
    background: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%);
    border: none;
}

.btn-primary:hover {
    background: linear-gradient(135deg, #2563eb 0%, #1e40af 100%);
}

.buy-button {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    border: none;
    color: white;
    font-weight: 500;
    transition: all 0.3s ease;
    width: 100%;
    text-align: center;
}

.buy-button:hover {
    background: linear-gradient(135deg, #d97706 0%, #b45309 100%);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(245, 158, 11, 0.3);
}

.buy-button:disabled {
    background: #6b7280;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.btn-outline-secondary {
    background: transparent;
    border: 1px solid #6b7280;
    color: #f3f4f6;
}

.btn-outline-secondary:hover {
    background: #6b7280;
    border-color: #6b7280;
    color: white;
}

/* Filter Toggle Animation */
.filter-toggle {
    transition: all 0.3s ease;
}

.filter-toggle.rotated {
    transform: rotate(180deg);
}

/* Filter Row Animation */
#filterRow {
    transition: all 0.3s ease;
    overflow: hidden;
}

#filterRow.show {
    display: block !important;
}

/* Alert Styling */
.alert {
    background: #374151;
    border: 1px solid #4b5563;
    color: white;
    border-radius: 8px;
}

.alert-info {
    background: #1e40af;
    border: 1px solid #3b82f6;
    color: #dbeafe;
}

/* Product Grid */
.product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
    margin-top: 2rem;
}

/* Desktop specific styling */
@media (min-width: 769px) {
    .product-grid {
        grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
        gap: 1.5rem;
    }
    
    .buy-button {
        padding: 0.5rem 1rem;
        font-size: 0.9rem;
        height: auto;
    }
}

.product-card {
    background: #1f2937;
    border: 1px solid #374151;
    border-radius: 10px;
    padding: 1.5rem;
    transition: all 0.3s ease;
    overflow: hidden;
}

.product-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(0,0,0,0.2);
    border-color: #f59e0b;
}

/* Product Image */
.product-image {
    width: 100%;
    height: 200px;
    background: #374151;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1rem;
    overflow: hidden;
    position: relative;
}

.product-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 8px;
}

.product-image i {
    color: #9ca3af;
    font-size: 3rem;
}

/* Product Content */
.product-title {
    color: white;
    font-weight: 600;
    margin-bottom: 0.5rem;
    font-size: 1.1rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
}

.product-description {
    color: #9ca3af;
    font-size: 0.875rem;
    margin-bottom: 1rem;
    line-height: 1.5;
}

.product-price {
    font-size: 1.25rem;
    font-weight: bold;
    color: #f59e0b;
    margin-bottom: 0.5rem;
}

.product-stock {
    margin-bottom: 1rem;
}

/* Stock Status */
.stock-status {
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.875rem;
    font-weight: 500;
    display: inline-block;
}

.in-stock {
    background-color: rgba(16, 185, 129, 0.2);
    color: #10b981;
}

.out-of-stock {
    background-color: rgba(239, 68, 68, 0.2);
    color: #ef4444;
}

/* Text Utilities */
.text-muted {
    color: #9ca3af !important;
}

.text-success {
    color: #10b981 !important;
}

.text-danger {
    color: #ef4444 !important;
}

.text-warning {
    color: #f59e0b !important;
}

/* Pagination */
.pagination {
    background: #1f2937;
}

.page-link {
    background: #374151;
    border: 1px solid #4b5563;
    color: #f3f4f6;
}

.page-link:hover {
    background: #4b5563;
    border-color: #6b7280;
    color: white;
}

.page-item.active .page-link {
    background: #f59e0b;
    border-color: #f59e0b;
    color: #111827;
}

.page-item.disabled .page-link {
    background: #374151;
    border-color: #4b5563;
    color: #6b7280;
}

/* Desktop Filter Behavior */
@media (min-width: 769px) {
    #filterRow {
        display: none !important;
    }
    
    /* Show desktop filter fields inline */
    .col-md-3 .input-group {
        display: flex !important;
    }
}

/* Responsive Design */
@media (max-width: 768px) {
    .product-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.75rem;
    }
    
    .product-card {
        padding: 0.75rem;
    }
    
    .product-image {
        height: 120px;
    }
    
    .product-title {
        font-size: 0.9rem;
        margin-bottom: 0.25rem;
    }
    
    .product-description {
        font-size: 0.75rem;
        margin-bottom: 0.5rem;
        line-height: 1.3;
    }
    
    .product-price {
        font-size: 1rem;
        margin-bottom: 0.25rem;
    }
    
    .product-stock {
        margin-bottom: 0.5rem;
    }
    
    .stock-status {
        font-size: 0.75rem;
        padding: 0.2rem 0.5rem;
    }
    
    .buy-button {
        padding: 0.4rem 0.5rem;
        font-size: 0.8rem;
        height: auto;
    }
    
    /* Mobile Filter Behavior */
    #filterRow {
        display: none !important;
    }
    
    #filterRow.show {
        display: block !important;
    }
    
    /* Hide desktop filter fields on mobile */
    .col-md-3 .input-group {
        display: none !important;
    }
    
    /* Mobile filter toggle button styling */
    #toggleFilter {
        border-radius: 0 6px 6px 0;
        border-left: none;
        background: #374151;
        border-color: #4b5563;
        color: #f3f4f6;
        width: 45px;
        padding: 0;
        display: flex;
        align-items: center;
        justify-content: center;
    }
    
    #toggleFilter:hover {
        background: #4b5563;
        border-color: #6b7280;
        color: white;
    }
    
    /* Ensure search and filter button are aligned */
    .input-group {
        height: auto;
    }
    
    .btn {
        height: auto;
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 0.875rem !important;
    }
    
    /* Reduce gaps on mobile */
    .row.g-3 {
        --bs-gutter-x: 0.75rem;
        --bs-gutter-y: 0.75rem;
    }
    
    .mb-2 {
        margin-bottom: 0.5rem !important;
    }
    
    /* Product actions mobile styling */
    .product-actions {
        margin-top: 0.75rem;
        gap: 0.4rem;
    }
    
    .product-actions .detail-btn {
        flex: 1;
    }
    
    .product-actions .buy-button {
        flex: 2;
    }
    

}

@media (max-width: 576px) {
    .product-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.5rem;
    }
    
    .product-card {
        padding: 0.5rem;
    }
    
    .product-image {
        height: 100px;
    }
    
    .product-title {
        font-size: 0.8rem;
        margin-bottom: 0.2rem;
    }
    
    .product-description {
        font-size: 0.7rem;
        margin-bottom: 0.4rem;
        line-height: 1.2;
    }
    
    .product-price {
        font-size: 0.9rem;
        margin-bottom: 0.2rem;
    }
    
    .product-stock {
        margin-bottom: 0.4rem;
    }
    
    .stock-status {
        font-size: 0.7rem;
        padding: 0.15rem 0.4rem;
    }
    
    .buy-button {
        padding: 0.3rem 0.4rem;
        font-size: 0.75rem;
        height: auto;
    }
    
    .detail-btn {
        font-size: 0.7rem;
        padding: 0.3rem 0.4rem;
    }
    
    .product-actions {
        margin-top: 0.5rem;
        gap: 0.3rem;
    }
}

/* Loading Spinner */
.loading-spinner {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 2rem 0;
}

.spinner-border {
    width: 2rem;
    height: 2rem;
    border-width: 0.2em;
}

.spinner-border.text-warning {
    color: #f59e0b !important;
}

/* Loading text styling */
.loading-spinner p {
    margin-top: 1rem;
    font-size: 0.9rem;
    color: #9ca3af;
}

/* Loading Animation */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.product-card {
    animation: fadeInUp 0.5s ease-out;
}

/* Infinite Scroll Loading */
#loadingSpinner {
    transition: all 0.3s ease;
}

#endMessage {
    transition: all 0.3s ease;
    padding: 2rem 0;
}

#endMessage .text-muted {
    color: #9ca3af !important;
}

#endMessage i {
    color: #10b981;
}

/* Product Actions Container */
.product-actions {
    display: flex;
    gap: 0.5rem;
    margin-top: 1rem;
}

.product-actions .detail-btn {
    flex: 1;
}

.product-actions .buy-button {
    flex: 2;
}

.detail-btn {
    font-size: 0.8rem;
    padding: 0.5rem 0.75rem;
    border-radius: 6px;
    background: transparent;
    border: 1px solid #3b82f6;
    color: #3b82f6;
    transition: all 0.3s ease;
    font-weight: 500;
    width: 100%;
    text-align: center;
}

.detail-btn:hover {
    background: #3b82f6;
    color: white;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(59, 130, 246, 0.3);
}

/* Modal Styling */
.modal-content {
    background: #1f2937;
    border: 1px solid #374151;
    color: white;
}

.modal-header {
    background: #374151;
    border-bottom: 1px solid #4b5563;
    color: white;
}

.modal-title {
    color: white;
}

.modal .btn-close {
    filter: invert(1);
}



.modal-body {
    background: #1f2937;
    color: white;
}

.modal-footer {
    background: #374151;
    border-top: 1px solid #4b5563;
}

.product-detail-image {
    background: #374151;
    border-radius: 8px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    height: 300px;
    position: relative;
    margin-bottom: 1rem;
    overflow: hidden;
}

.product-detail-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 6px;
}

.product-detail-image:empty::before {
    content: '\f03e';
    font-family: 'Font Awesome 5 Free';
    font-weight: 900;
    font-size: 3rem;
    color: #9ca3af;
}

.product-detail-price {
    font-size: 1.25rem;
    font-weight: bold;
}

#modalProductName {
    margin-top: 0.5rem;
    margin-bottom: 1rem;
    padding-top: 0.5rem;
}

.product-detail-description h6 {
    color: #f3f4f6;
    margin-bottom: 0.5rem;
}

.product-detail-description p {
    line-height: 1.6;
    color: #9ca3af;
}

/* Custom modal size for product detail */
#productDetailModal .modal-dialog {
    max-width: 500px;
    margin: 1.75rem auto;
    max-height: 90vh;
}

#productDetailModal .modal-content {
    max-height: 90vh;
    display: flex;
    flex-direction: column;
}

#productDetailModal .modal-header {
    position: sticky;
    top: 0;
    z-index: 1050;
    background: #374151;
    border-bottom: 1px solid #4b5563;
}

#productDetailModal .modal-body {
    flex: 1;
    overflow-y: auto;
    max-height: calc(90vh - 120px); /* Subtract header and footer height */
}

/* Custom scrollbar styling for modal */
#productDetailModal .modal-body::-webkit-scrollbar {
    width: 8px;
}

#productDetailModal .modal-body::-webkit-scrollbar-track {
    background: #374151;
    border-radius: 4px;
}

#productDetailModal .modal-body::-webkit-scrollbar-thumb {
    background: #6b7280;
    border-radius: 4px;
}

#productDetailModal .modal-body::-webkit-scrollbar-thumb:hover {
    background: #9ca3af;
}

/* Mobile responsive for modal */
@media (max-width: 576px) {
    #productDetailModal .modal-dialog {
        max-width: 95%;
        margin: 0.5rem auto;
        max-height: 95vh;
    }
    
    #productDetailModal .modal-content {
        max-height: 95vh;
    }
    
    #productDetailModal .modal-body {
        max-height: calc(95vh - 120px);
    }
}

/* Mobile responsive for detail button */
@media (max-width: 768px) {
    .detail-btn {
        font-size: 0.75rem;
        padding: 0.4rem 0.5rem;
    }
    
    .product-description-container {
        margin-bottom: 0.5rem;
    }
    
    .product-detail-image {
        height: 250px;
        margin-bottom: 0.75rem;
    }
    
    #modalProductName {
        margin-top: 0.25rem;
        margin-bottom: 0.75rem;
        padding-top: 0.25rem;
    }
    
    .main-content {
        padding-top: 5px;
    }
}

/* Small mobile responsive */
@media (max-width: 576px) {
    .product-detail-image {
        height: 200px;
        margin-bottom: 0.5rem;
    }
    
    #modalProductName {
        margin-top: 0.25rem;
        margin-bottom: 0.5rem;
        padding-top: 0.25rem;
        font-size: 1.1rem;
    }
    
    .main-content {
        padding-top: 3px;
    }
}

/* Toast Notification Styles */
.toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 9999;
}

.toast {
    background: #1f2937 !important;
    border: 1px solid #374151 !important;
    color: white !important;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06) !important;
    border-radius: 0.375rem !important;
    overflow: hidden !important;
}

.toast-header {
    background: #374151 !important;
    border-bottom: 1px solid #4b5563 !important;
    color: white !important;
    border-radius: 0.375rem 0.375rem 0 0 !important;
}

.toast-body {
    background: #1f2937 !important;
    color: white !important;
    border-radius: 0 0 0.375rem 0.375rem !important;
}

.toast.bg-warning {
    background: #92400e !important;
    border-color: #f59e0b !important;
}

.toast.bg-warning .toast-header {
    background: #78350f !important;
    border-bottom-color: #f59e0b !important;
}

.toast.bg-warning .toast-body {
    background: #92400e !important;
}

.toast.bg-success {
    background: #065f46 !important;
    border-color: #10b981 !important;
}

.toast.bg-success .toast-header {
    background: #064e3b !important;
    border-bottom-color: #10b981 !important;
}

.toast.bg-success .toast-body {
    background: #065f46 !important;
}

.toast.bg-danger {
    background: #991b1b !important;
    border-color: #dc2626 !important;
}

.toast.bg-danger .toast-header {
    background: #7f1d1d !important;
    border-bottom-color: #dc2626 !important;
}

.toast.bg-danger .toast-body {
    background: #991b1b !important;
}

.toast.bg-info {
    background: #1e3a8a !important;
    border-color: #3b82f6 !important;
}

.toast.bg-info .toast-header {
    background: #1e40af !important;
    border-bottom-color: #3b82f6 !important;
}

.toast.bg-info .toast-body {
    background: #1e3a8a !important;
} 