/* Custom CSS for OLX Clone */

:root {
    --primary-color: #00a651;
    --secondary-color: #f8f9fa;
    --text-dark: #333;
    --text-light: #666;
    --border-color: #e9ecef;
    --hover-color: #008f47;
}

/* Global Styles */
body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    color: var(--text-dark);
    line-height: 1.6;
}

/* Header Styles */
.navbar-brand {
    color: var(--primary-color) !important;
    font-size: 2rem !important;
    transition: transform 0.3s ease;
}

.navbar-brand:hover {
    transform: scale(1.05);
}

.navbar-brand img {
    transition: transform 0.3s ease;
}

.navbar-brand:hover img {
    transform: rotate(5deg);
}

.navbar-nav .nav-link {
    color: var(--text-dark) !important;
    font-weight: 500;
    padding: 0.5rem 1rem !important;
    transition: color 0.3s ease;
}

.navbar-nav .nav-link:hover {
    color: var(--primary-color) !important;
}

/* Search Section */
.search-container {
    max-width: 800px;
    margin: 0 auto;
}

.input-group .form-control {
    border-right: none;
}

.input-group .form-select {
    border-left: none;
    border-right: none;
}

.input-group .btn {
    border-left: none;
}

/* Categories Grid */
.categories-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 1rem;
    margin-top: 1rem;
}

.category-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 1.5rem 1rem;
    background: white;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    text-decoration: none;
    color: var(--text-dark);
    transition: all 0.3s ease;
    cursor: pointer;
}

.category-card:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 166, 81, 0.15);
}

.category-card i {
    font-size: 2rem;
    margin-bottom: 0.5rem;
}

.category-card span {
    font-size: 0.9rem;
    font-weight: 500;
    text-align: center;
}

/* Filter Sidebar */
.filter-sidebar {
    background: white;
    padding: 1.5rem;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    position: sticky;
    top: 20px;
}

.filter-title {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.filter-group {
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 1rem;
}

.filter-group:last-child {
    border-bottom: none;
}

.form-check {
    margin-bottom: 0.5rem;
}

.form-check-input:checked {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
}

.form-check-label {
    font-size: 0.9rem;
    color: var(--text-light);
}

/* Product Cards */
.product-card {
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    height: 100%;
    cursor: pointer;
}

.product-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

.product-image {
    width: 100%;
    height: 200px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 3rem;
    position: relative;
    overflow: hidden;
}

.product-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.product-badge {
    position: absolute;
    top: 10px;
    right: 10px;
    background: var(--primary-color);
    color: white;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 500;
}

.product-info {
    padding: 1rem;
}

.product-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: 0.5rem;
    line-height: 1.4;
    height: 2.8rem;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.product-price {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 0.5rem;
}

.product-location {
    font-size: 0.85rem;
    color: var(--text-light);
    margin-bottom: 0.5rem;
}

.product-date {
    font-size: 0.8rem;
    color: var(--text-light);
}

/* Results Header */
.results-header {
    background: white;
    padding: 1rem;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

/* Pagination */
.pagination .page-link {
    color: var(--primary-color);
    border-color: var(--border-color);
}

.pagination .page-item.active .page-link {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
}

.pagination .page-link:hover {
    color: var(--hover-color);
    background-color: var(--secondary-color);
}

/* Footer */
footer {
    background-color: #2c3e50 !important;
}

footer h6 {
    color: white;
    margin-bottom: 1rem;
}

footer a {
    transition: color 0.3s ease;
}

footer a:hover {
    color: var(--primary-color) !important;
}

.social-links a {
    font-size: 1.2rem;
    transition: transform 0.3s ease;
}

.social-links a:hover {
    transform: translateY(-2px);
}

/* Responsive Design */
@media (max-width: 768px) {
    .navbar-brand {
        font-size: 1.5rem !important;
    }
    
    .search-container {
        margin: 0;
    }
    
    .input-group .form-select {
        max-width: 150px;
    }
    
    .categories-grid {
        grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
        gap: 0.75rem;
    }
    
    .category-card {
        padding: 1rem 0.5rem;
    }
    
    .category-card i {
        font-size: 1.5rem;
    }
    
    .category-card span {
        font-size: 0.8rem;
    }
    
    .filter-sidebar {
        position: static;
        margin-bottom: 2rem;
    }
    
    .results-header {
        flex-direction: column;
        align-items: flex-start !important;
    }
    
    .results-header .d-flex {
        margin-top: 1rem;
        width: 100%;
    }
    
    .results-header select {
        width: 100% !important;
    }
    
    .product-image {
        height: 150px;
    }
    
    .product-image i {
        font-size: 2rem;
    }
}

@media (max-width: 576px) {
    .container {
        padding-left: 15px;
        padding-right: 15px;
    }
    
    .categories-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .product-card {
        margin-bottom: 1rem;
    }
    
    .navbar .d-flex {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .navbar .btn {
        width: 100%;
    }
}

/* Loading Animation */
.loading {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 200px;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid var(--border-color);
    border-top: 4px solid var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 3rem 1rem;
    color: var(--text-light);
}

.empty-state i {
    font-size: 4rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}

.empty-state h5 {
    margin-bottom: 0.5rem;
    color: var(--text-dark);
}

/* Utility Classes */
.text-primary {
    color: var(--primary-color) !important;
}

.bg-primary {
    background-color: var(--primary-color) !important;
}

.btn-primary {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
}

.btn-primary:hover {
    background-color: var(--hover-color);
    border-color: var(--hover-color);
}

.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);
}

/* Contact Page Styles */
.contact-item {
    display: flex;
    align-items: flex-start;
    margin-bottom: 1.5rem;
}

.contact-icon {
    width: 50px;
    height: 50px;
    background: var(--secondary-color);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 1rem;
    flex-shrink: 0;
}

.contact-details h5 {
    margin-bottom: 0.5rem;
    color: var(--text-dark);
}

.contact-details p {
    margin-bottom: 0;
    color: var(--text-light);
}

.contact-form {
    background: white;
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

/* About Page Styles */
.about-stats {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
}

.stat-item {
    text-align: center;
    padding: 1.5rem;
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.stat-number {
    font-size: 2rem;
    font-weight: bold;
    color: var(--primary-color);
    margin-bottom: 0.5rem;
}

.stat-label {
    font-size: 0.9rem;
    color: var(--text-light);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.mission-card {
    background: white;
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    height: 100%;
    text-align: center;
}

.mission-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.value-card {
    background: white;
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    height: 100%;
    transition: transform 0.3s ease;
}

.value-card:hover {
    transform: translateY(-5px);
}

.value-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.team-card {
    background: white;
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    height: 100%;
}

.team-photo {
    font-size: 4rem;
    margin-bottom: 1rem;
}

.timeline {
    position: relative;
    padding-left: 2rem;
}

.timeline::before {
    content: '';
    position: absolute;
    left: 1rem;
    top: 0;
    bottom: 0;
    width: 2px;
    background: var(--primary-color);
}

.timeline-item {
    position: relative;
    margin-bottom: 2rem;
}

.timeline-item::before {
    content: '';
    position: absolute;
    left: -1.5rem;
    top: 0.5rem;
    width: 1rem;
    height: 1rem;
    background: var(--primary-color);
    border-radius: 50%;
    border: 3px solid white;
    box-shadow: 0 0 0 3px var(--primary-color);
}

.timeline-year {
    position: absolute;
    left: -6rem;
    top: 0;
    font-weight: bold;
    color: var(--primary-color);
    font-size: 1.1rem;
}

.timeline-content {
    background: white;
    padding: 1.5rem;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    margin-left: 2rem;
}

.award-card {
    background: white;
    padding: 1.5rem;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    height: 100%;
}

.award-icon {
    font-size: 2.5rem;
    margin-bottom: 1rem;
}

/* Terms and Privacy Page Styles */
.terms-content, .privacy-content {
    background: white;
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.terms-section, .privacy-section {
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 2rem;
}

.terms-section:last-child, .privacy-section:last-child {
    border-bottom: none;
}

.contact-info {
    background: var(--secondary-color);
    padding: 1rem;
    border-radius: 8px;
    border-left: 4px solid var(--primary-color);
}

/* Product Detail Page Styles */
.product-gallery {
    position: sticky;
    top: 100px;
}

.main-image img {
    width: 100%;
    height: 400px;
    object-fit: cover;
    border: 1px solid var(--border-color);
    transition: transform 0.3s ease;
}

.main-image img:hover {
    transform: scale(1.02);
}

.thumbnail {
    cursor: pointer;
    opacity: 0.7;
    transition: opacity 0.3s ease;
    border: 2px solid transparent;
}

.thumbnail:hover {
    opacity: 1;
}

.thumbnail.active {
    opacity: 1;
    border-color: var(--primary-color);
}

.featured-badge .badge {
    font-size: 0.9rem;
    padding: 0.5rem 1rem;
}

.product-title {
    font-size: 2rem;
    font-weight: 700;
    color: var(--text-dark);
    line-height: 1.3;
}

.price-amount {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--primary-color);
}

.price-original {
    font-size: 1.2rem;
}

.price-discount {
    font-size: 1rem;
    font-weight: 600;
}

.key-features ul li {
    font-size: 1rem;
    color: var(--text-dark);
}

.product-info .info-item {
    padding: 0.5rem 0;
    border-bottom: 1px solid #f0f0f0;
}

.product-info .info-item:last-child {
    border-bottom: none;
}

.location-date {
    background: var(--secondary-color);
    padding: 1rem;
    border-radius: 8px;
    border-left: 4px solid var(--primary-color);
}

.action-buttons .btn {
    font-weight: 600;
    padding: 0.75rem 1.5rem;
}

.product-description {
    background: white;
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.description-content h5 {
    color: var(--primary-color);
    font-weight: 600;
}

.description-content ul {
    padding-left: 1.5rem;
}

.description-content ul li {
    margin-bottom: 0.5rem;
    color: var(--text-dark);
}

.seller-info {
    background: white;
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.seller-card {
    background: var(--secondary-color);
    padding: 1.5rem;
    border-radius: 8px;
    border: 1px solid var(--border-color);
}

.seller-avatar {
    font-size: 4rem;
    color: var(--primary-color);
    text-align: center;
}

.seller-rating .stars {
    color: #ffc107;
    font-size: 1.2rem;
}

.seller-contact-info .contact-item {
    padding: 0.5rem 0;
    border-bottom: 1px solid var(--border-color);
}

.seller-contact-info .contact-item:last-child {
    border-bottom: none;
}

.breadcrumb {
    background: transparent;
    padding: 0;
}

.breadcrumb-item + .breadcrumb-item::before {
    content: ">";
    color: var(--text-light);
}

.breadcrumb-item a {
    color: var(--primary-color);
    text-decoration: none;
}

.breadcrumb-item a:hover {
    text-decoration: underline;
}

.breadcrumb-item.active {
    color: var(--text-dark);
}

/* Similar Items Section */
.similar-items-section {
    background: var(--secondary-color);
}

/* Toast Notification Styles */
.toast-notification {
    font-family: inherit;
}

.toast-content {
    display: flex;
    align-items: center;
    font-weight: 500;
}

/* Mobile-First Responsive Design */

/* Mobile Filter Toggle */
.mobile-filter-toggle {
    display: none;
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 1000;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 50%;
    width: 56px;
    height: 56px;
    box-shadow: 0 4px 16px rgba(0, 166, 81, 0.4);
    font-size: 1.1rem;
    transition: all 0.3s ease;
}

.mobile-filter-toggle:hover {
    background: var(--hover-color);
    transform: scale(1.05);
    box-shadow: 0 6px 20px rgba(0, 166, 81, 0.5);
}

/* Mobile Filter Overlay */
.mobile-filter-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1050;
}

.mobile-filter-panel {
    position: fixed;
    top: 0;
    right: -100%;
    width: 85%;
    max-width: 350px;
    height: 100%;
    background: white;
    padding: 1rem;
    overflow-y: auto;
    transition: right 0.3s ease;
    z-index: 1051;
}

.mobile-filter-panel.active {
    right: 0;
}

.mobile-filter-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 1rem;
}

.mobile-filter-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--text-dark);
    cursor: pointer;
}

/* Mobile Categories - Hidden as per design */
.mobile-categories {
    display: none !important;
}

/* Mobile Search Bar */
.mobile-search-container {
    display: none;
    padding: 1rem;
    background: white;
    border-bottom: 1px solid var(--border-color);
}

/* Mobile Navigation - Hidden */
.mobile-nav {
    display: none !important;
}

.mobile-nav-item {
    display: flex;
    align-items: center;
    padding: 0.75rem;
    border-radius: 8px;
    margin-bottom: 0.5rem;
    text-decoration: none;
    color: var(--text-dark);
    transition: background-color 0.3s ease;
}

.mobile-nav-item:hover {
    background: var(--secondary-color);
    color: var(--text-dark);
}

.mobile-nav-item i {
    margin-right: 1rem;
    font-size: 1.2rem;
    width: 20px;
}

/* Mobile Results Header */
.mobile-results-header {
    display: none;
    padding: 1rem;
    background: white;
    border-bottom: 1px solid var(--border-color);
}

.mobile-sort-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.mobile-sort-label {
    font-weight: 600;
    color: var(--text-dark);
    font-size: 1rem;
}

.mobile-sort-select {
    border: 1px solid var(--border-color);
    border-radius: 6px;
    padding: 0.5rem 0.75rem;
    background: white;
    min-width: 140px;
    font-size: 0.9rem;
}

/* Mobile Product Cards */
.mobile-product-card {
    display: none;
    background: white;
    border-radius: 12px;
    margin: 1rem;
    overflow: hidden;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
    border: 1px solid #f0f0f0;
}

.mobile-product-image {
    width: 100%;
    height: 250px;
    object-fit: cover;
}

.mobile-product-info {
    padding: 1.25rem;
}

.mobile-product-title {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 0.75rem;
    line-height: 1.4;
    color: var(--text-dark);
}

.mobile-product-price {
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 0.75rem;
}

.mobile-product-location {
    font-size: 0.95rem;
    color: var(--text-light);
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
}

.mobile-product-location i {
    margin-right: 0.5rem;
    font-size: 0.9rem;
}

.mobile-product-date {
    font-size: 0.9rem;
    color: var(--text-light);
}

/* Mobile Pagination */
.mobile-pagination {
    display: none;
    padding: 1rem;
    text-align: center;
}

.mobile-pagination .btn {
    margin: 0 0.25rem;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    /* Show mobile elements */
    .mobile-filter-toggle,
    .mobile-search-container,
    .mobile-results-header,
    .mobile-product-card,
    .mobile-pagination {
        display: block;
    }
    
    /* Hide desktop elements */
    .filter-sidebar,
    .results-header,
    .product-card,
    .pagination {
        display: none !important;
    }
    
    /* Mobile layout adjustments */
    .container {
        padding: 0;
    }
    
    /* Header adjustments */
    .navbar-brand {
        font-size: 1.5rem !important;
    }
    
    .navbar .d-flex {
        flex-direction: row;
        gap: 0.5rem;
    }
    
    .navbar .btn {
        padding: 0.5rem 1rem;
        font-size: 0.9rem;
    }
    
    /* Search section adjustments */
    .search-container {
        display: none;
    }
    
    /* Hide only the categories grid in mobile, keep the heading */
    .categories-grid {
        display: none !important;
    }
    
    /* Main content adjustments */
    .row {
        margin: 0;
    }

    .bg-light {
        display: none;;
    }
    .mobile-py-4 {
        display: none;
    }
    
    .col-lg-3,
    .col-md-4 {
        padding: 0;
    }
    
    /* Mobile container adjustments */
    .container-fluid {
        padding: 0;
    }
    
    /* Mobile product grid */
    #mobileProductsGrid {
        padding: 0;
    }
    
    /* About page adjustments */
    .about-stats {
        grid-template-columns: 1fr;
    }
    
    .timeline-year {
        position: static;
        margin-bottom: 0.5rem;
        color: var(--primary-color);
        font-weight: bold;
    }
    
    .timeline-content {
        margin-left: 0;
    }
    
    .contact-item {
        flex-direction: column;
        text-align: center;
    }
    
    .contact-icon {
        margin-right: 0;
        margin-bottom: 1rem;
    }
    
    /* Product detail adjustments */
    .product-gallery {
        position: static;
    }
    
    .main-image img {
        height: 300px;
    }
    
    .product-title {
        font-size: 1.5rem;
    }
    
    .price-amount {
        font-size: 2rem;
    }
    
    .product-description,
    .seller-info {
        padding: 1.5rem;
    }
    
    .seller-card {
        padding: 1rem;
    }
    
    .seller-avatar {
        font-size: 3rem;
        margin-bottom: 1rem;
    }
    
    .action-buttons .btn {
        padding: 0.5rem 1rem;
        font-size: 0.9rem;
    }
    
    /* Mobile-specific styles */
    .mobile-product-card .product-image {
        height: 200px;
        position: relative;
    }
    
    .mobile-product-card .product-badge {
        position: absolute;
        top: 10px;
        right: 10px;
        background: var(--primary-color);
        color: white;
        padding: 0.25rem 0.5rem;
        border-radius: 4px;
        font-size: 0.75rem;
        font-weight: 500;
    }
}

@media (max-width: 576px) {
    .mobile-filter-panel {
        width: 90%;
    }
    
    .mobile-product-info {
        padding: 0.75rem;
    }
    
    .mobile-product-title {
        font-size: 0.95rem;
    }
    
    .mobile-product-price {
        font-size: 1.1rem;
    }
}
