/* public/assets/css/styles.css */

/* Fonts Integration */
@import url('https://fonts.googleapis.com/css2?family=Cairo:wght@300;400;600;700&family=Outfit:wght@300;400;500;600;700&display=swap');

:root {
    /* Color Palette - Light Mode (Sleek Slate & Indigo) */
    --bg-primary: #f8fafc;
    --bg-secondary: #ffffff;
    --text-primary: #0f172a;
    --text-secondary: #475569;
    --primary: #4f46e5;       /* Modern Indigo */
    --primary-hover: #4338ca;
    --accent: #fbbf24;        /* Gold for ratings/verify */
    --border-color: #e2e8f0;
    --glass-bg: rgba(255, 255, 255, 0.75);
    --glass-border: rgba(241, 245, 249, 0.8);
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.05), 0 4px 6px -2px rgba(0, 0, 0, 0.02);
    --font-sans: 'Outfit', sans-serif;
    --badge-verified: #0095f6;
    --chat-received-bg: #e2fcd5;
    --chat-received-text: #1b4332;
    --chat-received-border: #b7e4c7;
}

[data-theme="dark"] {
    /* Color Palette - Dark Mode (Midnight Blue & Indigo Accent) */
    --bg-primary: #0b0f19;
    --bg-secondary: #111827;
    --text-primary: #f3f4f6;
    --text-secondary: #9ca3af;
    --primary: #6366f1;
    --primary-hover: #4f46e5;
    --border-color: #1f2937;
    --glass-bg: rgba(17, 24, 39, 0.8);
    --glass-border: rgba(31, 41, 55, 0.8);
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.5);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.3), 0 2px 4px -1px rgba(0, 0, 0, 0.2);
    --shadow-lg: 0 20px 25px -5px rgba(0, 0, 0, 0.4), 0 10px 10px -5px rgba(0, 0, 0, 0.3);
    --chat-received-bg: #143625;
    --chat-received-text: #d8f3dc;
    --chat-received-border: #1b4332;
}

/* RTL Override for Arabic */
[dir="rtl"] {
    --font-sans: 'Cairo', sans-serif;
}

body {
    background-color: var(--bg-primary);
    color: var(--text-primary);
    font-family: var(--font-sans);
    transition: background-color 0.3s ease, color 0.3s ease;
    overflow-x: hidden;
}

/* Glassmorphism Navbar */
.navbar-custom {
    background: var(--glass-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border-color);
    transition: background 0.3s ease, border-color 0.3s ease;
}

.nav-link {
    color: var(--text-secondary);
    font-weight: 500;
    transition: color 0.2s ease;
}

.nav-link:hover, .nav-link.active {
    color: var(--primary);
}

/* Hero Section */
.hero-section {
    background: linear-gradient(135deg, rgba(79, 70, 229, 0.1) 0%, rgba(99, 102, 241, 0.05) 100%);
    border-radius: 24px;
    padding: 80px 40px;
    margin-bottom: 40px;
    position: relative;
    overflow: hidden;
}

.hero-section::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -20%;
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, rgba(99, 102, 241, 0.15) 0%, rgba(255, 255, 255, 0) 70%);
    border-radius: 50%;
    z-index: 0;
    pointer-events: none;
}

.hero-section .row {
    position: relative;
    z-index: 2;
}

/* Booking Style Search Widget */
.search-widget {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    padding: 24px;
    box-shadow: var(--shadow-lg);
    z-index: 10;
    position: relative;
    margin-top: -40px;
}

/* Premium Airbnb Cards */
.car-card {
    background-color: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    overflow: hidden;
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.3s ease;
    box-shadow: var(--shadow-sm);
    height: 100%;
    display: flex;
    flex-direction: column;
}

.car-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-lg);
}

.car-card-img-wrapper {
    position: relative;
    padding-top: 60%; /* Aspect ratio 16:10 */
    overflow: hidden;
    background-color: #f1f5f9;
}

.car-card-img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.car-card:hover .car-card-img {
    transform: scale(1.05);
}

.car-card-badge {
    position: absolute;
    top: 16px;
    left: 16px;
    z-index: 2;
}
[dir="rtl"] .car-card-badge {
    left: auto;
    right: 16px;
}

.favorite-btn {
    position: absolute;
    top: 16px;
    right: 16px;
    z-index: 2;
    background: rgba(255, 255, 255, 0.85);
    border: none;
    border-radius: 50%;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow-sm);
    color: #ef4444;
    transition: background 0.2s, transform 0.2s;
}

[dir="rtl"] .favorite-btn {
    right: auto;
    left: 16px;
}

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

.car-card-body {
    padding: 20px;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.car-specs {
    font-size: 0.875rem;
    color: var(--text-secondary);
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.car-price-tag {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--primary);
}

/* Store Details Banner */
.store-cover-banner {
    height: 280px;
    background-size: cover;
    background-position: center;
    border-radius: 24px;
    position: relative;
    margin-bottom: 80px;
}

.store-profile-meta {
    position: absolute;
    bottom: -10px;
    left: 40px;
    display: flex;
    align-items: flex-end;
    gap: 20px;
}

[dir="rtl"] .store-profile-meta {
    left: auto;
    right: 40px;
}

.store-logo-avatar {
    width: 120px;
    height: 120px;
    border-radius: 24px;
    border: 4px solid var(--bg-secondary);
    background-color: var(--bg-secondary);
    object-fit: cover;
    box-shadow: var(--shadow-md);
}

.store-meta-text {
    margin-bottom: 24px;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.75), 0 1px 3px rgba(0, 0, 0, 0.5);
}

/* Chat Dashboard & Live Messenger */
.chat-container {
    background-color: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    overflow: hidden;
    height: 600px;
    box-shadow: var(--shadow-md);
}

.conversations-sidebar {
    border-right: 1px solid var(--border-color);
    height: 100%;
    overflow-y: auto;
}

[dir="rtl"] .conversations-sidebar {
    border-right: none;
    border-left: 1px solid var(--border-color);
}

.conversation-item {
    padding: 16px;
    border-bottom: 1px solid var(--border-color);
    cursor: pointer;
    transition: background-color 0.2s;
    display: flex;
    align-items: center;
    gap: 12px;
}

.conversation-item:hover, .conversation-item.active {
    background-color: rgba(79, 70, 229, 0.05);
}

.chat-box {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.chat-history {
    flex-grow: 1;
    overflow-y: auto;
    padding: 24px;
    background-color: var(--bg-primary);
    display: flex;
    flex-direction: column;
    gap: 16px;
}

@keyframes messageSlideIn {
    from {
        opacity: 0;
        transform: translateY(12px) scale(0.97);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.message-bubble {
    max-width: 65%;
    padding: 10px 14px;
    border-radius: 16px;
    font-size: 0.925rem;
    line-height: 1.4;
    word-break: break-word;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
    animation: messageSlideIn 0.22s cubic-bezier(0.175, 0.885, 0.32, 1.1) forwards;
    transition: transform 0.2s ease, background-color 0.2s ease;
}

.message-bubble:hover {
    transform: scale(1.01);
}

.message-sent {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-hover) 100%);
    color: #ffffff;
    align-self: flex-end;
    border-bottom-right-radius: 4px;
}

.message-received {
    background-color: var(--chat-received-bg);
    color: var(--chat-received-text);
    align-self: flex-start;
    border-bottom-left-radius: 4px;
    border: 1px solid var(--chat-received-border);
}

/* Chat Image Styles */
.chat-img-clickable {
    transition: filter 0.2s ease, transform 0.2s ease;
}

.chat-img-clickable:hover {
    filter: brightness(0.9);
    transform: scale(1.01);
}

/* Chat Preview container */
.chat-image-preview-container .dark-bg-gray {
    background-color: var(--bg-secondary) !important;
    border-color: var(--border-color) !important;
}

.chat-image-preview-container {
    animation: messageSlideIn 0.2s cubic-bezier(0.1, 0.8, 0.2, 1) forwards;
}

/* Lightbox Modal custom dark styles */
#lightboxModal .modal-content {
    background-color: rgba(15, 23, 42, 0.95) !important;
    backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
}

#lightboxModal .btn-close-white {
    opacity: 0.8;
}

#lightboxModal .btn-close-white:hover {
    opacity: 1;
}

/* Ticks / Double check custom color rules */
.message-status .text-info {
    color: #34b7f1 !important; /* WhatsApp blue */
}

[data-theme="dark"] .message-status .text-info {
    color: #00a884 !important; /* WhatsApp business green / teal */
}


/* Forms Style */
.form-control-custom {
    background-color: var(--bg-primary);
    border: 1px solid var(--border-color);
    color: var(--text-primary) !important;
    border-radius: 12px;
    padding: 12px 16px;
}

.form-control-custom:focus {
    background-color: var(--bg-secondary);
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(79, 70, 229, 0.15);
}

/* Buttons */
.btn-indigo {
    background-color: var(--primary);
    color: white;
    border-radius: 12px;
    padding: 12px 24px;
    font-weight: 600;
    transition: background-color 0.2s, transform 0.1s;
    border: none;
}

.btn-indigo:hover {
    background-color: var(--primary-hover);
    color: white;
    transform: translateY(-1px);
}

.btn-indigo:active {
    transform: translateY(1px);
}

/* Star Rating widget */
.rating-stars-input {
    display: flex;
    flex-direction: row-reverse;
    justify-content: flex-end;
    gap: 8px;
}

.rating-stars-input input {
    display: none;
}

.rating-stars-input label {
    font-size: 2rem;
    color: #cbd5e1;
    cursor: pointer;
    transition: color 0.1s;
}

.rating-stars-input input:checked ~ label,
.rating-stars-input label:hover,
.rating-stars-input label:hover ~ label {
    color: var(--accent);
}

/* Dashboards stats card */
.stat-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    padding: 24px;
    box-shadow: var(--shadow-sm);
}

.stat-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    background: rgba(79, 70, 229, 0.1);
    color: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
}

/* Verification Badge */
.verified-badge {
    color: var(--badge-verified);
    display: inline-flex;
    align-items: center;
}
.verified-badge-agency {
    color: #fbbf24 !important; /* Gold */
    display: inline-flex;
    align-items: center;
}
.verified-badge-owner {
    color: #0095f6 !important; /* Blue */
    display: inline-flex;
    align-items: center;
}

/* Gold Highlighted Listing Card */
.car-card-highlighted {
    border-color: #fbbf24 !important;
    box-shadow: 0 0 15px rgba(251, 191, 36, 0.25) !important;
    background: linear-gradient(to bottom, rgba(251, 191, 36, 0.03), var(--bg-secondary)) !important;
}
.car-card-highlighted:hover {
    box-shadow: 0 0 20px rgba(251, 191, 36, 0.45) !important;
    transform: translateY(-8px);
}

/* Toast container positioning */
.toast-container-custom {
    position: fixed;
    top: 24px;
    right: 24px;
    z-index: 1060;
}

[dir="rtl"] .toast-container-custom {
    right: auto;
    left: 24px;
}

/* Custom file upload buttons */
.file-upload-wrapper {
    position: relative;
    border: 2px dashed var(--border-color);
    border-radius: 12px;
    padding: 30px;
    text-align: center;
    background: var(--bg-primary);
    cursor: pointer;
}
.file-upload-wrapper input[type="file"] {
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    opacity: 0;
    cursor: pointer;
}

/* Mobile Responsiveness & Button Click Fix */
@media (max-width: 991.98px) {
    .hero-section {
        padding: 48px 24px;
        margin-bottom: 24px;
    }
    
    .search-widget {
        margin-top: 0;
        z-index: 5;
    }
}

/* Hover animations for admin dashboard cards */
.hover-card {
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.3s ease, border-color 0.3s ease;
}
.hover-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg) !important;
    border-color: var(--primary) !important;
}

/* Pulse animation for notifications badge */
.animate-pulse {
    animation: pulse-glow 2s infinite;
}
@keyframes pulse-glow {
    0% {
        box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.7);
    }
    70% {
        box-shadow: 0 0 0 6px rgba(239, 68, 68, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(239, 68, 68, 0);
    }
}
