/**
 * Enhanced Listing Page Styles
 * Custom styles for the redesigned listing page
 */

/* Enhanced gradient backgrounds */
.gradient-card {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.gradient-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

/* Improved button transitions */
.rental-type-btn {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    transform: translateY(0);
}

.rental-type-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.15);
}

.rental-type-btn.active {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.25);
}

/* Enhanced form inputs */
.form-input-enhanced {
    transition: all 0.3s ease;
    border: 2px solid #e5e7eb;
}

.form-input-enhanced:focus {
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
    transform: translateY(-1px);
}

/* New unified layout styles */
.main-content-container {
    background-color: #f9fafb;
    min-height: 100vh;
}

.product-layout {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

@media (min-width: 1024px) {
    .product-layout {
        flex-direction: row;
        gap: 2rem;
    }
}

.product-left-column {
    flex: 1;
    min-width: 0;
}

.product-right-column {
    width: 100%;
}

@media (min-width: 1024px) {
    .product-right-column {
        width: 41.67%; /* w-5/12 */
        flex-shrink: 0;
    }
}

.pricing-card-sticky {
    position: sticky;
    top: 1.5rem;
    z-index: 10;
    align-self: flex-start;
}

/* Tab functionality styles */
.tab-button {
    position: relative;
    transition: all 0.3s ease;
    border-bottom: 2px solid transparent;
    padding: 0.75rem 0.25rem;
    font-weight: 500;
    cursor: pointer;
}

.tab-button:hover {
    color: #6366f1;
    border-bottom-color: #c7d2fe;
}

.tab-button.active {
    color: #8A4FFF;
    border-bottom-color: #8A4FFF;
}

.tab-content {
    display: none;
    animation: fadeIn 0.3s ease-in-out;
}

.tab-content.active {
    display: block;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Improved card hover effects */
.listing-card {
    transition: all 0.3s ease;
}

.listing-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
}

/* Enhanced price display */
.price-highlight {
    color: #8A4FFF;
    font-weight: 700;
}

/* Primary color updates to match design */
.text-primary { color: #8A4FFF !important; }
.bg-primary { background-color: #8A4FFF !important; }
.border-primary { border-color: #8A4FFF !important; }
.hover\:bg-primary\/90:hover { background-color: rgba(138, 79, 255, 0.9) !important; }
.hover\:bg-primary\/5:hover { background-color: rgba(138, 79, 255, 0.05) !important; }
.hover\:bg-primary\/20:hover { background-color: rgba(138, 79, 255, 0.2) !important; }
.bg-primary\/10 { background-color: rgba(138, 79, 255, 0.1) !important; }

/* Improved owner section */
.owner-section {
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    border: 1px solid #e2e8f0;
}

.owner-avatar {
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.15);
    transition: all 0.3s ease;
}

.owner-avatar:hover {
    box-shadow: 0 6px 16px rgba(102, 126, 234, 0.25);
    transform: scale(1.05);
}

/* Enhanced detail cards */
.detail-card {
    transition: all 0.3s ease;
    border: 1px solid transparent;
    border-radius: 8px;
    background: white;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.detail-card:hover {
    border-color: rgba(138, 79, 255, 0.2);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

/* Custom rounded button style */
.rounded-button {
    border-radius: 8px;
}

/* About the owner section */
.owner-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.75rem;
}

.owner-stat-item {
    background: #f9fafb;
    padding: 0.75rem;
    border-radius: 8px;
    text-align: center;
}

.owner-stat-value {
    font-size: 1.125rem;
    font-weight: 600;
    color: #374151;
}

.owner-stat-label {
    font-size: 0.75rem;
    color: #6b7280;
    margin-top: 0.25rem;
}

/* Improved favorite button */
.favorite-btn {
    transition: all 0.3s ease;
}

.favorite-btn:hover {
    background-color: #fef2f2;
    transform: scale(1.1);
}

.favorite-btn.active {
    background-color: #fef2f2;
}

/* Enhanced breadcrumb */
.breadcrumb-enhanced {
    background: linear-gradient(90deg, #ffffff 0%, #f8fafc 100%);
}

/* Improved date inputs */
input[type="date"] {
    position: relative;
}

input[type="date"]::-webkit-calendar-picker-indicator {
    opacity: 0;
    position: absolute;
    right: 0;
    width: 100%;
    height: 100%;
    cursor: pointer;
}

/* Enhanced price summary */
.price-summary {
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    border: 1px solid #e2e8f0;
}

.price-summary-total {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Mobile responsive enhancements */
@media (max-width: 768px) {
    .product-layout {
        gap: 1rem;
    }
    
    .main-product-image {
        aspect-ratio: 4/3;
    }
    
    .gallery-thumbnail {
        min-width: 80px;
        height: 60px;
    }
    
    .tab-button {
        padding: 0.5rem 0.25rem;
        font-size: 0.875rem;
    }
    
    .owner-stats {
        gap: 0.5rem;
    }
    
    .owner-stat-item {
        padding: 0.5rem;
    }
    
    .pricing-card-sticky {
        position: static;
        top: auto;
    }
}

/* Loading states */
.loading-overlay {
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(4px);
}

.loading-spinner {
    border: 3px solid #f3f4f6;
    border-top: 3px solid #667eea;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Success states */
.success-state {
    background: linear-gradient(135deg, #ecfdf5 0%, #d1fae5 100%);
    border-color: #10b981;
}

/* Error states */
.error-state {
    background: linear-gradient(135deg, #fef2f2 0%, #fee2e2 100%);
    border-color: #ef4444;
}

/* Enhanced image gallery */
.image-gallery {
    display: flex;
    gap: 0.5rem;
    overflow-x: auto;
    padding-bottom: 0.5rem;
    scrollbar-width: thin;
    scrollbar-color: #d1d5db #f3f4f6;
}

.image-gallery::-webkit-scrollbar {
    height: 6px;
}

.image-gallery::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 10px;
}

.image-gallery::-webkit-scrollbar-thumb {
    background: #c5c5c5;
    border-radius: 10px;
}

.image-gallery::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

.gallery-thumbnail {
    min-width: 100px;
    height: 80px;
    border-radius: 8px;
    overflow: hidden;
    border: 2px solid transparent;
    cursor: pointer;
    transition: all 0.3s ease;
}

.gallery-thumbnail:hover {
    border-color: rgba(138, 79, 255, 0.5);
    transform: scale(1.05);
}

.gallery-thumbnail.active {
    border-color: #8A4FFF;
}

.gallery-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: top;
    transition: all 0.3s ease;
}

.main-product-image {
    aspect-ratio: 16/9;
    overflow: hidden;
    border-radius: 8px;
    margin-bottom: 1rem;
}

.main-product-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: top;
    transition: all 0.3s ease;
}

.main-product-image img:hover {
    transform: scale(1.02);
}

/* Improved rating display */
.rating-stars {
    color: #fbbf24;
    filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.1));
}

/* Enhanced contact button */
.contact-owner-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    transition: all 0.3s ease;
}

.contact-owner-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(102, 126, 234, 0.3);
}

/* Inline Calendar Widget Styles */
.calendar-day-button {
    transition: all 0.2s ease;
    border-radius: 8px;
    font-weight: 500;
}

.calendar-day-button:hover:not(:disabled) {
    background-color: rgba(139, 92, 246, 0.1);
    transform: scale(1.05);
}

.calendar-day-selected {
    background: linear-gradient(135deg, #8B5CF6 0%, #7C3AED 100%);
    color: white;
    font-weight: 600;
    box-shadow: 0 2px 8px rgba(139, 92, 246, 0.3);
}

.calendar-day-in-range {
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.2) 0%, rgba(124, 58, 237, 0.2) 100%);
    color: #8B5CF6;
    font-weight: 600;
}

.calendar-day-today {
    border: 2px solid #8B5CF6;
    color: #8B5CF6;
    font-weight: 600;
}

.calendar-day-disabled {
    color: #d1d5db;
    cursor: not-allowed;
    opacity: 0.5;
}

.calendar-navigation-btn {
    transition: all 0.2s ease;
}

.calendar-navigation-btn:hover {
    background-color: #f3f4f6;
    transform: scale(1.1);
}

/* Date display boxes */
.date-display-box {
    transition: all 0.3s ease;
    border: 2px solid #e5e7eb;
}

.date-display-box.selected {
    border-color: #8B5CF6;
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.05) 0%, rgba(124, 58, 237, 0.05) 100%);
}

.date-display-box:hover {
    border-color: #c4b5fd;
    transform: translateY(-1px);
}

/* Restricted drop-off display for hourly rentals */
.date-display-box.hourly-restricted {
    opacity: 0.6;
    background: linear-gradient(135deg, rgba(156, 163, 175, 0.1) 0%, rgba(107, 114, 128, 0.1) 100%);
    border-color: #d1d5db;
    position: relative;
}

.date-display-box.hourly-restricted::after {
    content: 'Same day as pickup';
    position: absolute;
    bottom: -20px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 10px;
    color: #6b7280;
    white-space: nowrap;
    font-weight: 500;
}

/* Time selection dropdowns */
.time-select-enhanced {
    transition: all 0.3s ease;
    border: 2px solid #e5e7eb;
}

.time-select-enhanced:focus {
    border-color: #8B5CF6;
    box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.1);
    transform: translateY(-1px);
}

/* Clear dates button */
.clear-dates-btn {
    transition: all 0.2s ease;
    color: #8B5CF6;
}

.clear-dates-btn:hover {
    color: #7C3AED;
    transform: scale(1.05);
}

/* Calendar widget container */
.calendar-widget-container {
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    transition: all 0.3s ease;
}

.calendar-day {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-weight: 500;
}

.calendar-day:hover:not(.unavailable) {
    background-color: rgba(138, 79, 255, 0.1);
    transform: scale(1.05);
}

.calendar-day.selected {
    background-color: #8A4FFF;
    color: white;
    box-shadow: 0 2px 8px rgba(138, 79, 255, 0.3);
}

.calendar-day.unavailable {
    color: #d1d5db;
    text-decoration: line-through;
    cursor: not-allowed;
    opacity: 0.5;
}

.calendar-day.today {
    border: 2px solid #8A4FFF;
    color: #8A4FFF;
    font-weight: 600;
}

.calendar-day.in-range {
    background-color: rgba(138, 79, 255, 0.2);
    color: #8A4FFF;
    font-weight: 600;
}

/* Calendar header */
.calendar-header {
    padding: 16px;
    border-bottom: 1px solid #f3f4f6;
}

.calendar-month-year {
    font-size: 18px;
    font-weight: 600;
    color: #374151;
}

/* Calendar grid enhancements */
.calendar-grid {
    padding: 16px;
}

.calendar-days-header {
    margin-bottom: 8px;
}

.calendar-day-header {
    font-size: 12px;
    font-weight: 500;
    color: #6b7280;
    text-align: center;
    padding: 8px 0;
}

/* Reviews section enhancements */
.review-item {
    transition: all 0.3s ease;
    padding: 1.5rem;
    border-radius: 8px;
    border: 1px solid transparent;
}

.review-item:hover {
    border-color: rgba(138, 79, 255, 0.1);
    background-color: rgba(138, 79, 255, 0.02);
}

.rating-distribution {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}

.rating-bar {
    flex: 1;
    height: 8px;
    background-color: #e5e7eb;
    border-radius: 4px;
    overflow: hidden;
}

.rating-bar-fill {
    height: 100%;
    background-color: #fbbf24;
    border-radius: 4px;
    transition: width 0.3s ease;
}

/* Specifications grid */
.specs-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1rem;
}

.spec-item {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
}

.spec-icon {
    width: 2rem;
    height: 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background-color: rgba(138, 79, 255, 0.1);
    color: #8A4FFF;
    flex-shrink: 0;
    margin-top: 0.25rem;
}

/* Mobile responsiveness for calendar */
@media (max-width: 768px) {
    .calendar-day {
        width: 36px;
        height: 36px;
        font-size: 14px;
    }
    
    .specs-grid {
        grid-template-columns: 1fr;
    }
    
    .rating-distribution {
        flex-direction: column;
        align-items: stretch;
        gap: 0.25rem;
    }
}