/* Custom styles for the Inter font and general theme variables */
body {
    font-family: 'Inter', sans-serif;
    transition: background-color 0.3s ease, color 0.3s ease; /* Smooth transition for theme change */
    --color-primary: #f59e0b; /* Amber 500 */
    --color-primary-dark: #d97706; /* Amber 700 */
    --color-secondary: #1f2937; /* Gray 800 */
    --color-secondary-light: #374151; /* Gray 700 */
}
/* Styles for dark mode */
html.dark {
    background-color: #1a202c;
    color: #e2e8f0;
}
html.dark .bg-white {
    background-color: #2d3748;
}
html.dark .text-gray-800 {
    color: #e2e8f0;
}
html.dark .text-gray-900 {
    color: #f8f8f8;
}
html.dark .text-gray-600 {
    color: #a0aec0;
}
html.dark .border-gray-200 {
    border-color: #4a5568;
}
html.dark .shadow-lg {
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.5), 0 4px 6px -2px rgba(0, 0, 0, 0.2);
}
html.dark .hover\:bg-gray-100:hover {
    background-color: #4a5568;
}
html.dark .btn-primary {
    background-color: var(--color-primary);
}
html.dark .btn-secondary {
    background-color: var(--color-secondary);
}
html.dark .text-blue-500 {
    color: #60a5fa;
}
html.dark input,
html.dark select,
html.dark textarea {
    background-color: #2d3748;
    color: #e2e8f0;
    border-color: #4a5568;
}
html.dark input::placeholder,
html.dark textarea::placeholder {
    color: #a0aec0;
}

/* Light mode specific colors */
html:not(.dark) body {
    background-color: #fdf8f1;
    color: #1f2937;
}
html:not(.dark) .bg-white {
    background-color: #ffffff;
}
html:not(.dark) .bg-gray-50,
html:not(.dark) .bg-gray-100 {
    background-color: #fdf8f1;
}
html:not(.dark) .text-gray-800 {
    color: #1a202c;
}
html:not(.dark) .text-gray-900 {
    color: #000000;
}
html:not(.dark) .text-gray-600 {
    color: #1a202c;
}
html:not(.dark) .btn-primary {
    background-color: var(--color-primary);
}
html:not(.dark) .btn-primary:hover {
    background-color: var(--color-primary-dark);
}
html:not(.dark) .hover\:text-amber-500:hover,
html:not(.dark) .text-amber-500 {
    color: var(--color-primary);
}
html:not(.dark) .bg-amber-500 {
     background-color: var(--color-primary);
}
html:not(.dark) input,
html:not(.dark) select,
html:not(.dark) textarea {
    background-color: #ffffff;
    color: #1f2937;
    border-color: #d1d5db;
}
html:not(.dark) input::placeholder,
html:not(.dark) textarea::placeholder {
    color: #6b7280;
}

/* Hero Section background image */
.hero-bg {
    background-image: linear-gradient(to right, rgba(0, 0, 0, 0.7), rgba(0, 0, 0, 0.4)), url('https://brixtonforged.com/wp-content/uploads/2022/11/brixton-forged-pf10-carbon-10-7-22-7-617x771.jpg');
    background-size: cover;
    background-position: center;
}

/* Product Card image styling */
.product-image-container {
    height: 200px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    background-color: transparent;
    border-radius: 0.5rem 0.5rem 0 0;
}
.product-image-container img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}
.product-card:hover .product-image-container img {
    transform: scale(1.05);
}

/* Product Card Hover Effect */
.product-card {
    cursor: pointer;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}
.product-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}
.dark .product-card:hover {
    box-shadow: 0 20px 25px -5px rgba(255, 255, 255, 0.05), 0 10px 10px -5px rgba(255, 255, 255, 0.02);
}

/* Rate My Car card styling */
.rate-my-car-card {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}
.rate-my-car-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}
.dark .rate-my-car-card:hover {
     box-shadow: 0 20px 25px -5px rgba(245, 158, 11, 0.1), 0 10px 10px -5px rgba(245, 158, 11, 0.05);
}
.rate-my-car-card .card-image {
    height: 250px;
    object-fit: cover;
    cursor: pointer;
    transition: transform 0.3s ease;
}
.rate-my-car-card:hover .card-image {
    transform: scale(1.05);
}
.rate-my-car-card .owner-avatar {
    width: 40px;
    height: 40px;
    border: 2px solid white;
}
.rate-my-car-card .action-btn {
    transition: all 0.2s ease-in-out;
}
.rate-my-car-card .action-btn:hover {
    transform: scale(1.1);
}
.rate-my-car-card .auction-badge {
    background: linear-gradient(45deg, #ef4444, #f59e0b);
    text-shadow: 1px 1px 2px rgba(0,0,0,0.5);
}

/* Tabs for Showcase/Auctions */
.tab-button {
    color: #6b7280; /* Gray-500 */
    border-bottom: 3px solid transparent;
    transition: all 0.3s ease;
}
.dark .tab-button {
    color: #9ca3af; /* Gray-400 */
}
.tab-button.active {
    color: var(--color-primary);
    border-bottom-color: var(--color-primary);
}
.dark .tab-button.active {
    color: var(--color-primary);
}
.tab-button:hover {
    color: var(--color-primary-dark);
}

/* Active Navigation Link Indicator */
.nav-link.active, .mobile-nav-link.active {
    position: relative; 
    color: var(--color-primary) !important;
}
.nav-link.active::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    width: 100%;
    height: 2px;
    background-color: var(--color-primary);
}
.mobile-nav-link.active {
    border-left: 4px solid var(--color-primary);
    padding-left: 1rem;
}

/* Mobile Nav and Cart Sidebar transitions */
#cart-sidebar, #mobile-nav {
    transition: transform 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}
#mobile-nav { transform: translateX(-100%); }
#mobile-nav.open { transform: translateX(0); }
#cart-sidebar { transform: translateX(100%); }
#cart-sidebar.open { transform: translateX(0); }

/* Category Card hover effect */
.category-card {
    background-size: cover;
    background-position: center;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}
.category-card:hover { transform: scale(1.05); }

/* Button styles */
.btn-primary {
    background-color: var(--color-primary);
    color: white;
    transition: background-color 0.3s;
}
.btn-primary:hover {
    background-color: var(--color-primary-dark);
}
.btn-secondary {
    background-color: var(--color-secondary);
    color: white;
    transition: background-color 0.3s;
}
.btn-secondary:hover {
    background-color: var(--color-secondary-light);
}

/* Cart item layout */
.cart-item {
    display: grid;
    grid-template-columns: 80px 1fr auto;
    gap: 1rem;
    align-items: center;
}

/* Profile Card hover effect */
.profile-card {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}
.profile-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 20px -5px rgba(0, 0, 0, 0.1);
}

/* Form transition for login/signup toggle */
.form-section {
    transition: opacity 0.3s ease-in-out, transform 0.3s ease-in-out;
    opacity: 0;
    transform: translateY(20px);
    position: absolute;
    width: 100%;
    top: 0;
    left: 0;
    padding: 2rem;
}
.form-section.active {
    opacity: 1;
    transform: translateY(0);
    position: static;
}
.form-container-relative {
    position: relative;
    min-height: 480px;
}

/* Custom Confirmation Modal */
#confirmation-modal, #donation-modal {
    background-color: rgba(0, 0, 0, 0.6);
    transition: opacity 0.3s ease;
}
#confirmation-modal.hidden, #donation-modal.hidden {
    opacity: 0;
    pointer-events: none;
}
#confirmation-modal-content {
    transform: translateY(-20px);
    transition: transform 0.3s ease;
}
#confirmation-modal.active #confirmation-modal-content {
    transform: translateY(0);
}

/* Donation Modal */
.gift-item {
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    border: 2px solid transparent;
}
.gift-item:hover {
    transform: scale(1.05);
    box-shadow: 0 0 15px rgba(245, 158, 11, 0.5);
    border-color: var(--color-primary);
}
.gift-item img {
    width: 80px;
    height: 80px;
    object-fit: contain;
}

/* Chat page specific styles */
.chat-container {
    display: flex;
    height: calc(100vh - 120px);
    max-width: 1000px;
    margin: 20px auto;
    border: 1px solid #ccc;
    border-radius: 8px;
    overflow: hidden;
    background-color: #fff;
}
.chat-main-content {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}
.chat-header {
    background-color: var(--color-primary);
    color: white;
    padding: 15px;
    font-size: 1.25rem;
    font-weight: bold;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-shrink: 0;
}
.chat-messages {
    flex-grow: 1;
    padding: 15px;
    overflow-y: auto;
    background-color: #f8f8f8;
}
.chat-input-area {
    display: flex;
    flex-direction: column;
    padding: 15px;
    border-top: 1px solid #eee;
    background-color: #fff;
    flex-shrink: 0;
}
.chat-input-area .flex {
    display: flex;
    width: 100%;
}
.chat-input-area input {
    flex-grow: 1;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    margin-right: 10px;
}
.chat-input-area button {
    background-color: var(--color-primary);
    color: white;
    padding: 10px 15px;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.2s;
}
.chat-input-area button:hover {
    background-color: var(--color-primary-dark);
}
.message-bubble {
    margin-bottom: 10px;
    padding: 8px 12px;
    border-radius: 15px;
    max-width: 70%;
    word-wrap: break-word;
}
.message-bubble.sent {
    background-color: #dcf8c6;
    align-self: flex-end;
    margin-left: auto;
}
.message-bubble.received {
    background-color: #e8e8e8;
    align-self: flex-start;
    margin-right: auto;
}

/* Dark mode specific chat styles */
html.dark .chat-container {
    background-color: #2d3748;
    border-color: #4a5568;
}
html.dark .chat-messages {
    background-color: #1a202c;
}
html.dark .chat-input-area {
    background-color: #2d3748;
    border-top-color: #4a5568;
}
html.dark .chat-input-area input {
    background-color: #4a5568;
    color: #e2e8f0;
    border-color: #606f7b;
}
html.dark .chat-input-area input::placeholder {
    color: #a0aec0;
}
html.dark .message-bubble.sent {
    background-color: #48bb78;
    color: #1a202c;
}
html.dark .message-bubble.received {
    background-color: #4a5568;
    color: #e2e8f0;
}
.offer-price-input {
    margin-top: 10px;
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
    width: calc(100% - 100px);
}
.offer-price-button {
    padding: 8px 12px;
    background-color: #f59e0b;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
}
.offer-price-button:hover {
    background-color: #d97706;
}

/* Seller Profile Sidebar in Chat */
.seller-profile-sidebar {
    width: 280px;
    flex-shrink: 0;
    background-color: #f0f0f0;
    border-left: 1px solid #eee;
    padding: 15px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    text-align: center;
}
html.dark .seller-profile-sidebar {
    background-color: #2d3748;
    border-left-color: #4a5568;
}
.seller-profile-sidebar .seller-avatar {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    object-fit: cover;
    margin-bottom: 10px;
}
.seller-profile-sidebar .seller-name {
    font-size: 1.125rem;
    font-weight: bold;
    color: #1f2937;
    margin-bottom: 5px;
}
html.dark .seller-profile-sidebar .seller-name {
    color: #e2e8f0;
}
.seller-profile-sidebar .seller-rating {
    color: #f59e0b;
    margin-bottom: 5px;
}
.seller-profile-sidebar .seller-reviews-count {
    font-size: 0.875rem;
    color: #6b7280;
    margin-bottom: 15px;
}
html.dark .seller-profile-sidebar .seller-reviews-count {
    color: #a0aec0;
}
.seller-profile-sidebar .seller-bio {
    font-size: 0.875rem;
    color: #4a5568;
    margin-bottom: 15px;
}
