/**
 * Main Stylesheet
 */

 /* Green color scheme */
:root {
    --primary-color: #2e8b57;        /* Sea Green - Main brand color */
    --primary-dark: #1f6e43;         /* Darker green for hover states */
    --primary-light: #3aab6e;        /* Lighter green for highlights */
    --primary-very-light: #e8f5ee;   /* Very light green for backgrounds */
    --accent-color: #f8f9d7;         /* Light yellow-green for accents */
    --success-color: #4caf50;        /* Green for success states */
    --text-light: #f8f9fa;           /* Light text on dark backgrounds */
    --text-dark: #343a40;            /* Dark text on light backgrounds */
    --border-color: #dee2e6;         /* Light gray for borders */
}

/* General Styles */
html, body {
    margin: 0;
    padding: 0;
}

body {
    background-color: #f8f9fa;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    color: var(--text-dark);
    min-height: 100vh;
}

.row {
    justify-content: center
}

/* Navbar Styling */
.site-header .navbar {
    background-color: var(--primary-color);
    padding-top: 1rem;
    padding-bottom: 1rem;
}

.navbar-dark .navbar-nav .nav-link {
    color: rgba(255, 255, 255, 1);
    cursor: pointer;
}

.navbar-dark .navbar-nav .nav-link:hover,
.navbar-dark .navbar-nav .nav-link:focus {
    color: #fff;
    cursor: pointer;
}

.navbar-dark .navbar-nav .nav-link.active {
    color: #fff;
    font-weight: 500;
    cursor: pointer;
}

.btn-outline-light:hover {
    background-color: var(--accent-color);
    color: var(--primary-dark);
    border-color: var(--accent-color);
}

.navbar-nav .nav-item-link {
    color: rgba(255, 255, 255, 1);
    text-decoration: none;
    padding: 0.5rem 1rem;
    display: block;
}

.navbar-nav .nav-item-link:hover, 
.navbar-nav .nav-item-link:focus {
    color: rgba(255, 255, 255, 0.75);
}

.navbar-nav .nav-item-link.active {
    color: #fff;
    font-weight: bold;
}

.user-nav-link {
    display: block;
    padding: 0.5rem 1rem;
    color: #495057;
    text-decoration: none;
    background-color: transparent;
    border: 1px solid transparent;
    border-top-left-radius: 0.25rem;
    border-top-right-radius: 0.25rem;
}

.user-nav-link:hover, .user-nav-link:focus {
    border-color: #e9ecef #e9ecef #dee2e6;
    isolation: isolate;
}

.user-nav-link.active {
    color: #2e8b57;
    background-color: #fff;
    border-color: #dee2e6 #dee2e6 #fff;
}

/* Hero Container and Image */
.hero-container {
    position: relative;
    width: 100%;
    height: calc(100vh - 75px);
    min-height: 450px;
    max-height: 820px;
    overflow: hidden;
    margin-bottom: 2rem;
}

.hero-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
}

.hero-content {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 100%;
    max-width: 600px;
    z-index: 1;
}

.hero-text-container {
    background-color: rgba(46, 139, 87, 0.85);
    color: white;
    border-radius: 1rem;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.2);
}

.hero-text-container h1 {
    font-weight: 700;
    margin-bottom: 1rem;
}

/* Sections */
section h2 {
    color: var(--primary-color);
    border-bottom: 2px solid var(--primary-light);
    padding-bottom: 0.5rem;
    margin-bottom: 1.5rem;
}

/* Store Carousel */
#storeCarousel {
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
    border-radius: 0.5rem;
    overflow: hidden;
}

.carousel-item {
    height: 350px;
}

.carousel-item img {
    height: 100%;
    object-fit: cover;
}

.carousel-indicators {
    margin-bottom: 0.5rem;
}

.carousel-indicators button {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background-color: rgba(255, 255, 255, 0.5);
    border: none;
}

.carousel-indicators button.active {
    background-color: white;
}

/* Footer */




.footer {
    background-color: var(--primary-color);
    margin-top: 2rem;
}

.footer h5 {
    color: var(--accent-color);
    font-weight: 600;
    margin-bottom: 1rem;
}

.footer a:hover {
    color: var(--accent-color) !important;
}

.social-icons a {
    font-size: 1.25rem;
    margin-right: 1rem;
}

/* Button styling */
.btn-primary {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
}

.btn-primary:hover, 
.btn-primary:focus {
    background-color: var(--primary-dark);
    border-color: var(--primary-dark);
}

.btn-outline-primary {
    color: var(--primary-color);
    border-color: var(--primary-color);
}

.btn-outline-primary:hover {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
}

#featured-items {
    display: flex;
    flex-wrap: wrap;
}

/* Card styling */
/* Enhanced Card Styles */
.card {
    border-radius: 0.5rem;
    overflow: hidden;
    box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
    transition: box-shadow 0.3s ease;
}

.card:hover {
    box-shadow: 0 0.1rem 0.5rem rgba(0, 0, 0, 0.15);
}




/* Table Styles */
.table th {
    font-weight: 600;
    color: var(--text-dark);
}

.table-hover tbody tr:hover {
    background-color: var(--primary-very-light);
}

/* Status Badge */
.status-badge {
    padding: 0.25rem 0.5rem;
    border-radius: 0.25rem;
    font-size: 0.75rem;
    font-weight: 500;
}

.status-available {
    background-color: #d4edda;
    color: #155724;
}

.status-sold {
    background-color: #e2e3e5;
    color: #383d41;
}

/* Tabs Styling */
.nav-tabs .nav-link {
    color: var(--text-dark);
}

.nav-tabs .nav-link.active {
    color: var(--primary-color);
    font-weight: 500;
    border-bottom-color: var(--primary-color);
}

/* Form Styling */
.form-control:focus, 
.form-select:focus {
    border-color: var(--primary-light);
    box-shadow: 0 0 0 0.25rem rgba(46, 139, 87, 0.25);
}

.form-label {
    font-weight: 500;
    color: var(--text-dark);
}

/* Login Modal */
.modal-header {
    background-color: var(--primary-color);
    color: white;
}

/* Action Buttons */
.action-btn {
    min-width: 60px;
}

.sell-btn {
    background-color: var(--success-color);
    border-color: var(--success-color);
    color: white;
}

.sell-btn:hover {
    background-color: #3d8b40;
    border-color: #3d8b40;
}

.sell-btn.disabled {
    background-color: #8bc34a;
    border-color: #8bc34a;
    pointer-events: none;
}

.delete-btn {
    color: #dc3545;
    border-color: #dc3545;
}

.delete-btn:hover {
    background-color: #f8d7da;
}

/* Notes cell truncation */
.notes-cell {
    max-width: 200px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Item Details Page */
.item-image-container {
    background-color: #f8f9fa;
    border-radius: 0.5rem;
    box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
    text-align: center;
}

.item-details {
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.item-price-status {
    display: flex;
    justify-content: center;
    align-items: flex-start;
    flex-direction: column;
}

.price-container {
    border-radius: 0.5rem;
    margin-top: 1rem;

}


.related-items {
    border-top: 1px solid var(--border-color);
    padding-top: 1.5rem;
}

#card-controls {
    display: flex;
    justify-content: space-between;
}

/* Admin Panel Specific */
#inventory-system {
    background-color: white;
    border-radius: 0.5rem;
    box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
}

#transaction-history-table {
    font-size: 0.9rem;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .hero-container {
        height: 60vh;
        min-height: 350px;
    }
    
    .hero-content {
        width: 90%;
    }
    
    .carousel-item {
        height: 250px;
    }
    
    .action-btn {
        padding: 0.25rem 0.5rem;
        font-size: 0.75rem;
        min-width: 50px;
    }
    
    .container {
        padding-left: 15px;
        padding-right: 15px;
    }

    .item-image-container {
        margin-bottom: 1.5rem;
    }
}

/* Animation for loading content */
.loading {
    position: relative;
    min-height: 200px;
}

.loading::after {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    width: 50px;
    height: 50px;
    margin-top: -25px;
    margin-left: -25px;
    border: 5px solid var(--primary-light);
    border-top: 5px solid var(--primary-dark);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}


/* Enhanced Clickable Row Styles */
.clickable-row {
    cursor: pointer;
    transition: background-color 0.2s ease-in-out;
}

.clickable-row:hover {
    background-color: var(--primary-very-light);
}

.clickable-row:active {
    background-color: var(--primary-light);
    color: white;
}

/* Hover effect for action buttons within rows */
.clickable-row .btn-group {
    position: relative;
    z-index: 2; /* Ensure buttons appear above the row clickable area */
}

/* Make action buttons stand out more on hover */
.clickable-row:hover .btn-outline-secondary,
.clickable-row:hover .btn-outline-danger {
    border-width: 2px;
}

/* Add slight padding to table cells for better spacing */
#inventory-table td {
    padding: 0.75rem;
    vertical-align: middle;
}

/* Style for highlighting search matches */
.highlight-match {
    background-color: rgba(252, 248, 227, 0.5);
    font-weight: 500;
}

/* Language Switcher and Button Consistency */
.language-switcher .btn {
    width: 37px;  /* Square buttons */
    height: 37px; /* Same width and height */
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    margin-right: 0.5rem;
}

.language-switcher .btn:last-child {
    margin-right: 0;
}

.login-btn {
    height: 40px;  /* Match language button height */
    display: inline-flex;
    align-items: center;
    padding: 0 0.75rem;
}

/* Ensure consistent vertical alignment */
.language-switcher,
.login-btn {
    display: flex;
    align-items: center;
}

address i {
    width: 20px;
}

/* Enhanced Add Item Tab Styles */

/* Card styling for add item form */
#add .card {
    box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
    border-radius: 0.5rem;
    overflow: hidden;
    margin-bottom: 1.5rem;
}

#add .card-title {
    color: var(--primary-color);
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 0.75rem;
}

/* Image container styling */
#add .item-image-container {
    height: 250px;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #f8f9fa;
    border-radius: 0.5rem;
    overflow: hidden;
}

#add .item-image-container img {
    max-height: 100%;
    max-width: 100%;
    object-fit: contain;
}

/* Form field spacing */
#add label.form-label {
    font-weight: 500;
    margin-bottom: 0.3rem;
}

#add .form-control,
#add .form-select {
    margin-bottom: 0.75rem;
}

/* Checkbox styling */
#add .form-check {
    padding-top: 0.5rem;
}

#add .form-check-input:checked {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
}

/* Button styling */
#add .btn-primary {
    min-width: 120px;
}

#add .btn-outline-secondary {
    min-width: 100px;
}

/* Animation for image change */
#new-item-image {
    transition: all 0.3s ease;
}

/* Required field indicator */
#add .form-label[for="item-title"]::after,
#add .form-label[for="item-category"]::after {
    content: " *";
    color: #dc3545;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    #add .item-image-container {
        height: 200px;
    }
    
    #add .col-md-8,
    #add .col-md-4 {
        margin-bottom: 0.5rem;
    }
}

/* Mobile responsiveness for inventory table */
@media (max-width: 767.98px) {
    #public-inventory-table {
      border: 0;
    }
    
    #public-inventory-table thead {
      display: none; /* Hide the header on mobile */
    }
    
    #public-inventory-table tr {
      display: block;
      margin-bottom: 1rem;
      border-radius: 0.5rem;
      box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.5);
      overflow: hidden;
      background-color: white;
      border: 1px solid var(--border-color);
    }
    
    #public-inventory-table td {
      display: flex;
      justify-content: space-between;
      padding: 0.75rem 1rem;
      text-align: right;
      border-bottom: 1px solid var(--border-color);
    }
    
    #public-inventory-table td:last-child {
      border-bottom: 0;
    }
    
    #public-inventory-table td::before {
      content: attr(data-label);
      font-weight: 600;
      text-align: left;
      color: var(--primary-color);
    }
    
    /* Adjust display for better spacing */

    
    /* Make the entire row clickable while maintaining styles */
    #public-inventory-table .clickable-row {
      cursor: pointer;
      transition: transform 0.2s;
    }
    
    #public-inventory-table .clickable-row:hover {
      transform: translateY(-2px);
    }
  }


  /* Full width tabs for admin panel */
#inventory-tabs {
    width: 100%;
    display: flex;
}

#inventory-tabs .nav-item {
    flex: 1;
}

#inventory-tabs .nav-link {
    text-align: center;
    width: 100%;
    height: 100%;
    border-radius: 0;
    padding: 12px 8px;
    font-weight: 400;
    transition: all 0.3s ease;
}

#inventory-tabs .nav-link:hover {
    background-color: #f8f9fa;
    border-color: #dee2e6;
}

#inventory-tabs .nav-link.active {
    background-color: #fff;
    border-color: #dee2e6 #dee2e6 #fff;
    font-weight: 600;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    #inventory-tabs .nav-link {
        padding: 8px 4px;
        font-size: 0.9rem;
    }
}

@media (max-width: 576px) {
    #inventory-tabs {
        flex-wrap: wrap;
    }
    
    #inventory-tabs .nav-item {
        flex: 0 0 50%;
        max-width: 50%;
    }
    
    #inventory-tabs .nav-link {
        font-size: 0.8rem;
        padding: 6px 2px;
    }
}
/* Fix for product card carousel heights on homepage */

/* Mobile carousel height fix */
.d-block.d-md-none .carousel.slide.h-100 {
    height: 180px !important;
}

.d-block.d-md-none .carousel.slide.h-100 .carousel-inner.h-100 {
    height: 180px !important;
}

.d-block.d-md-none .carousel.slide.h-100 .carousel-item.h-100 {
    height: 180px !important;
}

/* Desktop carousel height fix */
.d-none.d-md-block .carousel.slide {
    height: 180px !important;
}

.d-none.d-md-block .carousel.slide .carousel-inner {
    height: 180px !important;
}

.d-none.d-md-block .carousel.slide .carousel-item {
    height: 180px !important;
}

/* Ensure carousel images maintain proper sizing */
.card .carousel-item img {
    height: 180px !important;
    object-fit: cover !important;
}

/* Hide carousel controls on product cards */
#featured-items .carousel-control-prev,
#featured-items .carousel-control-next,
#recommended-items .carousel-control-prev,
#recommended-items .carousel-control-next {
    display: none !important;
}

/* Also hide controls for any product carousels */
.card .carousel-control-prev,
.card .carousel-control-next {
    display: none !important;
}

/* Hide carousel indicators (dots) on product cards */
#featured-items .carousel-indicators,
#recommended-items .carousel-indicators {
    display: none !important;
}

/* Also hide indicators for any product carousels */
.card .carousel-indicators {
    display: none !important;
}

/* Alternative approach - target all product carousels on homepage */
#featured-items .carousel.slide,
#recommended-items .carousel.slide {
    height: 180px !important;
}

#featured-items .carousel-inner,
#recommended-items .carousel-inner {
    height: 180px !important;
}

#featured-items .carousel-item,
#recommended-items .carousel-item {
    height: 180px !important;
}

#featured-items .carousel-item img,
#recommended-items .carousel-item img {
    height: 180px !important;
    object-fit: cover !important;
}

.d-inline {
    padding: 0 5px;
}

/* Single Product Page Image Styling */
.index-item-image-container {
    background-color: #f8f9fa;
    border-radius: 0.5rem;
    text-align: center;
    width: 100%;
    aspect-ratio: 1 / 1; /* Perfect square */
    display: flex;
    align-items: center;
    justify-content: center;
}

/* All product images on single product page */
.product-image {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    cursor: pointer;
    display: block;
}

/* Carousel specific styling for single product page */
#productImageCarousel {
    width: 100%;
    height: 100%;
}

#productImageCarousel .carousel-inner {
    height: 100%;
}

#productImageCarousel .carousel-item {
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Override any conflicting carousel styles from homepage */
#productImageCarousel .carousel-item img {
    height: auto !important;
    max-height: 100% !important;
    width: auto !important;
    max-width: 100% !important;
    object-fit: contain !important;
}

/* Lightbox modal styles */
#imageModal .modal-body {
    background-color: rgba(0, 0, 0, 0.95);
}

#imageModal img {
    cursor: pointer;
}


/* Clean Elegant Carousel Styling */
/* Center carousel content vertically */
#simpleCarousel {
    position: relative;
    width: 100%;
    height: 100%;
    overflow: hidden;
    border-radius: 0.5rem;
    display: flex;
    align-items: center; /* Centers the carousel content vertically */
    justify-content: center; /* Centers horizontally */
}

#carouselImage {
    transition: opacity 0.4s ease-in-out;
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    display: block;
}

.carousel-nav-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%) scaleY(2); /* This stretches the symbols vertically! */
    background: none;
    color: white;
    border: none;
    width: 25px;
    height: 95px;
    font-size: 36px;
    font-weight: 600;
    cursor: pointer;
    border-radius: 50%;
    z-index: 10;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0.8;
    text-shadow: 0 2px 2px rgba(0, 0, 0, 0.5);
}

.carousel-nav-btn:hover {
    opacity: 1;
    transform: translateY(-50%) scaleY(2) scale(1.05); /* Keep the stretch on hover */
    color: var(--primary-color);
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
}

.carousel-nav-btn:active {
    transform: translateY(-50%) scaleY(2) scale(0.95); /* Keep the stretch on click */
}
.prev-btn {
    left: 5px;
}

.next-btn {
    right: 5px;
}

.carousel-dots {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 12px;
    z-index: 10;
    padding: 0;
}

.dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.6);
    cursor: pointer;
    transition: all 0.3s ease;
    border: 1px solid rgba(255, 255, 255, 0.3);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.dot:hover {
    background: rgba(255, 255, 255, 0.9);
    transform: scale(1.2);
    border-color: rgba(255, 255, 255, 0.8);
}

.dot.active {
    background: white;
    transform: scale(1.3);
    border-color: white;
    box-shadow: 0 0 0 2px var(--primary-color);
}

/* Mobile responsiveness */
@media (max-width: 768px) {
    .carousel-nav-btn {
        width: 40px;
        height: 40px;
        font-size: 20px;
        opacity: 0.9;
    }
    
    .prev-btn {
        left: 10px;
    }
    
    .next-btn {
        right: 10px;
    }
    
    .carousel-dots {
        bottom: 15px;
        gap: 10px;
    }
    
    .dot {
        width: 10px;
        height: 10px;
    }
}