/* CCHub Frontend Styles
   Place this in: cchub-info-services/assets/css/cchub-frontend.css
   Version: 2.0 - Optimized Typography
*/

:root {
    /* Colors */
    --cchub-primary: #0F6A3D;
    --cchub-primary-dark: #0A4F2E;
    --cchub-primary-light: #E8F5E9;
    --cchub-secondary: #FF9800;
    --cchub-accent: #10B981;
    --cchub-gradient: linear-gradient(135deg, #0F6A3D 0%, #2E8B57 100%);
    
    /* Shadows */
    --cchub-shadow-sm: 0 1px 2px rgba(0,0,0,0.05);
    --cchub-shadow-md: 0 4px 6px -1px rgba(0,0,0,0.1);
    --cchub-shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.1);
    --cchub-shadow-xl: 0 20px 25px -5px rgba(0,0,0,0.1);
    
    /* Font Size Scale - Modern Typography */
    --text-xs: 0.75rem;     /* 12px */
    --text-sm: 0.875rem;    /* 14px */
    --text-base: 1rem;      /* 16px */
    --text-lg: 1.125rem;    /* 18px */
    --text-xl: 1.25rem;     /* 20px */
    --text-2xl: 1.5rem;     /* 24px */
    --text-3xl: 1.875rem;   /* 30px */
    --text-4xl: 2.25rem;    /* 36px */
    --text-5xl: 3rem;       /* 48px */
    
    /* Font Weights */
    --font-normal: 400;
    --font-medium: 500;
    --font-semibold: 600;
    --font-bold: 700;
    --font-extrabold: 800;
    
    /* Line Heights */
    --leading-tight: 1.25;
    --leading-normal: 1.5;
    --leading-relaxed: 1.625;
}

/* Base Typography */
html {
    font-size: 16px;
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-size: var(--text-base);
    line-height: var(--leading-normal);
    color: #1F2937;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
}

/* Responsive Base Font */
@media (max-width: 768px) {
    html {
        font-size: 14px;
    }
}

/* Clean image loading - fade in only (no pulse) */
img {
    background: #F3F4F6;
    opacity: 0;
    transition: opacity 0.3s ease-in;
}

img.loaded {
    opacity: 1;
}

/* Smooth transitions for interactive elements */
button, 
a, 
.car-card, 
.job-card,
.category-card {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Better focus states for accessibility */
button:focus, 
a:focus, 
input:focus, 
select:focus, 
textarea:focus {
    outline: 2px solid var(--cchub-primary);
    outline-offset: 2px;
}

/* Custom scrollbar for modern browsers */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: #F1F1F1;
    border-radius: 10px;
}

::-webkit-scrollbar-thumb {
    background: var(--cchub-primary);
    border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--cchub-primary-dark);
}

/* Loading spinner for AJAX requests */
.cchub-loader {
    display: inline-block;
    width: 40px;
    height: 40px;
    border: 3px solid var(--cchub-primary-light);
    border-top-color: var(--cchub-primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Toast notification styles */
.cchub-toast {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: white;
    padding: 12px 20px;
    border-radius: 12px;
    box-shadow: var(--cchub-shadow-lg);
    border-left: 4px solid var(--cchub-primary);
    z-index: 9999;
    animation: slideIn 0.3s ease;
    font-size: var(--text-sm);
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* ========================================
   CAR CARD STYLES - Archive & Grid
   ======================================== */
.car-card {
    background: white;
    border-radius: 20px;
    overflow: hidden;
    transition: all 0.3s ease;
    box-shadow: var(--cchub-shadow-sm);
    border: 1px solid #E5E7EB;
}

.car-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--cchub-shadow-xl);
    border-color: var(--cchub-primary);
}

.car-card-image {
    position: relative;
    height: 220px;
    overflow: hidden;
}

.car-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s;
}

.car-card:hover .car-card-image img {
    transform: scale(1.05);
}

.car-card-badge {
    position: absolute;
    top: 12px;
    right: 12px;
    background: var(--cchub-secondary);
    color: white;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: var(--text-xs);
    font-weight: var(--font-semibold);
    letter-spacing: 0.3px;
}

.car-card-content {
    padding: 1.25rem;
}

.car-card-title {
    font-size: var(--text-lg);
    font-weight: var(--font-bold);
    margin: 0 0 0.5rem;
    color: #1F2937;
    line-height: var(--leading-tight);
}

.car-card-price {
    font-size: var(--text-2xl);
    font-weight: var(--font-extrabold);
    color: var(--cchub-primary);
    margin: 0.75rem 0;
    line-height: var(--leading-tight);
}

.car-card-specs {
    display: flex;
    gap: 1rem;
    margin: 1rem 0;
    font-size: var(--text-sm);
    color: #6B7280;
}

.car-card-location {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    color: #6B7280;
    font-size: var(--text-sm);
    margin-top: 0.75rem;
    padding-top: 0.75rem;
    border-top: 1px solid #E5E7EB;
}

/* ========================================
   JOB CARD STYLES - Archive & Grid
   ======================================== */
.job-card {
    background: white;
    border-radius: 20px;
    padding: 1.25rem;
    transition: all 0.3s ease;
    box-shadow: var(--cchub-shadow-sm);
    border: 1px solid #E5E7EB;
}

.job-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--cchub-shadow-lg);
    border-color: var(--cchub-primary);
}

.job-card-title {
    font-size: var(--text-lg);
    font-weight: var(--font-bold);
    margin: 0 0 0.25rem;
    color: #1F2937;
    line-height: var(--leading-tight);
}

.job-card-company {
    color: #6B7280;
    font-size: var(--text-sm);
    margin-bottom: 0.75rem;
    line-height: var(--leading-normal);
}

.job-card-meta {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
    margin: 1rem 0;
}

.job-meta-tag {
    font-size: var(--text-xs);
    padding: 0.25rem 0.75rem;
    background: #F3F4F6;
    border-radius: 20px;
    color: #4B5563;
    font-weight: var(--font-medium);
}

.job-meta-tag.highlight {
    background: var(--cchub-primary-light);
    color: var(--cchub-primary);
}

.job-card-location {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    color: #6B7280;
    font-size: var(--text-sm);
    margin-top: 0.75rem;
    padding-top: 0.75rem;
    border-top: 1px solid #E5E7EB;
}

/* ========================================
   SINGLE LISTING PAGE STYLES
   ======================================== */
.cchub-listing-container {
    max-width: 1200px;
    margin: 2.5rem auto;
    padding: 0 1.25rem;
}

.cchub-listing-main {
    width: 100%;
    margin-bottom: 3rem;
}

.cchub-details-card {
    background: white;
    border-radius: 24px;
    padding: 2rem;
    box-shadow: var(--cchub-shadow-sm);
    border: 1px solid #E5E7EB;
}

/* Page Title */
.cchub-title {
    font-size: var(--text-4xl);
    font-weight: var(--font-extrabold);
    margin: 0 0 0.5rem;
    line-height: var(--leading-tight);
    letter-spacing: -0.02em;
    color: #1F2937;
}

/* Price/Salary Badges */
.price,
.salary {
    font-size: var(--text-3xl);
    font-weight: var(--font-extrabold);
    padding: 0.5rem 1.25rem;
    background: var(--cchub-primary-light);
    border-radius: 40px;
    color: var(--cchub-primary);
}

.boosted-badge {
    background: linear-gradient(135deg, #FF9800, #F57C00);
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: var(--text-xs);
    font-weight: var(--font-semibold);
}

/* Section Headers */
.cchub-details-card h3,
.cchub-description h3,
.cchub-requirements h3,
.cchub-how-to-apply h3 {
    font-size: var(--text-xl);
    font-weight: var(--font-bold);
    margin: 0 0 1rem;
    color: #1F2937;
}

/* Meta Grid for Jobs */
.cchub-job-meta-grid,
.cchub-specs-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1.25rem;
    margin-bottom: 2rem;
    padding: 1.25rem;
    background: #F9FAFB;
    border-radius: 16px;
}

@media (max-width: 768px) {
    .cchub-job-meta-grid,
    .cchub-specs-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1rem;
    }
}

.meta-item,
.spec-item {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.meta-icon,
.spec-icon {
    font-size: 1.25rem;
}

.meta-label,
.spec-label {
    font-size: var(--text-xs);
    font-weight: var(--font-semibold);
    letter-spacing: 0.5px;
    text-transform: uppercase;
    color: #6B7280;
}

.meta-value,
.spec-value {
    font-size: var(--text-sm);
    font-weight: var(--font-semibold);
    color: #1F2937;
}

/* Description Sections */
.cchub-description,
.cchub-requirements,
.cchub-how-to-apply {
    margin: 1.5rem 0;
    padding: 1.25rem;
    background: #F9FAFB;
    border-radius: 16px;
}

.cchub-description p,
.cchub-requirements p {
    font-size: var(--text-base);
    line-height: var(--leading-relaxed);
    color: #4B5563;
    margin: 0;
}

.apply-box {
    background: white;
    padding: 1rem;
    border-radius: 12px;
    border-left: 4px solid var(--cchub-primary);
}

.apply-box p {
    margin: 0;
    font-size: var(--text-base);
    color: #1F2937;
}

/* Contact Cards */
.cchub-employer-card,
.cchub-contact-card {
    background: linear-gradient(135deg, #F9FAFB 0%, #F3F4F6 100%);
    border-radius: 16px;
    padding: 1.5rem;
    margin-top: 1.5rem;
}

.contact-info p,
.employer-info p {
    font-size: var(--text-sm);
    margin: 0.5rem 0;
    color: #4B5563;
}

/* Buttons */
.cchub-whatsapp-btn,
.cchub-apply-btn {
    width: 100%;
    background: #25D366;
    color: white;
    border: none;
    padding: 0.875rem;
    border-radius: 12px;
    font-weight: var(--font-semibold);
    font-size: var(--text-base);
    cursor: pointer;
    transition: all 0.2s;
    margin-top: 1rem;
}

.cchub-whatsapp-btn:hover,
.cchub-apply-btn:hover {
    transform: translateY(-2px);
}

.cchub-whatsapp-btn:hover {
    background: #128C7E;
}

.cchub-apply-btn:hover {
    background: var(--cchub-primary-dark);
}

/* Gallery Styles for Cars */
.cchub-gallery {
    margin-bottom: 1.5rem;
}

.gallery-main {
    background: #F9FAFB;
    border-radius: 16px;
    overflow: hidden;
    margin-bottom: 1rem;
    text-align: center;
    min-height: 400px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.gallery-main img {
    max-width: 100%;
    max-height: 500px;
    object-fit: contain;
}

.gallery-thumbs {
    display: flex;
    gap: 0.75rem;
    overflow-x: auto;
    padding: 0.5rem 0;
}

.gallery-thumbs .thumb {
    width: 80px;
    height: 80px;
    border-radius: 12px;
    overflow: hidden;
    cursor: pointer;
    border: 2px solid transparent;
    transition: all 0.2s;
    flex-shrink: 0;
}

.gallery-thumbs .thumb:hover,
.gallery-thumbs .thumb.active {
    border-color: var(--cchub-primary);
}

.gallery-thumbs .thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* ========================================
   RELATED CARDS - Horizontal Scroll
   ======================================== */
.cchub-related-section {
    margin: 3rem 0 2rem;
}

.related-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.25rem;
}

.related-header h3 {
    font-size: var(--text-2xl);
    font-weight: var(--font-bold);
    color: #1F2937;
    margin: 0;
}

.scroll-controls {
    display: flex;
    gap: 0.5rem;
}

.scroll-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: white;
    border: 1px solid #E5E7EB;
    cursor: pointer;
    font-size: 1.125rem;
    font-weight: var(--font-bold);
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.scroll-btn:hover {
    background: var(--cchub-primary);
    color: white;
    border-color: var(--cchub-primary);
}

.cchub-horizontal-scroll {
    display: flex;
    gap: 1.25rem;
    overflow-x: auto;
    scroll-behavior: smooth;
    padding: 0.5rem 0.25rem 1rem 0.25rem;
    scrollbar-width: thin;
}

.cchub-horizontal-scroll::-webkit-scrollbar {
    height: 8px;
}

.cchub-horizontal-scroll::-webkit-scrollbar-track {
    background: #F1F1F1;
    border-radius: 10px;
}

.cchub-horizontal-scroll::-webkit-scrollbar-thumb {
    background: var(--cchub-primary);
    border-radius: 10px;
}

.related-job-card,
.related-car-card {
    flex: 0 0 300px;
    background: white;
    border-radius: 16px;
    text-decoration: none;
    transition: all 0.3s ease;
    border: 1px solid #E5E7EB;
    box-shadow: var(--cchub-shadow-sm);
    overflow: hidden;
}

.related-job-card:hover,
.related-car-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--cchub-shadow-lg);
    border-color: var(--cchub-primary);
}

.related-car-card .card-image {
    height: 160px;
    overflow: hidden;
}

.related-car-card .card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s;
}

.related-car-card:hover .card-image img {
    transform: scale(1.05);
}

.related-job-card .card-content,
.related-car-card .card-content {
    padding: 1rem;
}

.related-job-card h4,
.related-car-card h4 {
    font-size: var(--text-base);
    font-weight: var(--font-bold);
    margin: 0 0 0.5rem;
    color: #1F2937;
    line-height: var(--leading-tight);
}

.card-company {
    font-size: var(--text-sm);
    color: #6B7280;
    margin-bottom: 0.5rem;
}

.card-price {
    font-size: var(--text-lg);
    font-weight: var(--font-extrabold);
    color: var(--cchub-primary);
    margin: 0.5rem 0;
}

.card-meta {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin: 0.5rem 0;
}

.card-meta .meta-tag {
    font-size: var(--text-xs);
    padding: 0.25rem 0.5rem;
}

.card-location {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    color: #6B7280;
    font-size: var(--text-xs);
    margin-top: 0.5rem;
    padding-top: 0.5rem;
    border-top: 1px solid #E5E7EB;
}

/* ========================================
   ARCHIVE PAGE STYLES
   ======================================== */
.cchub-archive-container {
    max-width: 1400px;
    margin: 2.5rem auto;
    padding: 0 1.25rem;
}

.cchub-archive-header {
    text-align: center;
    margin-bottom: 2rem;
}

.cchub-archive-header h1 {
    font-size: var(--text-5xl);
    font-weight: var(--font-extrabold);
    color: #1F2937;
    margin: 0 0 0.5rem;
    letter-spacing: -0.02em;
}

@media (max-width: 768px) {
    .cchub-archive-header h1 {
        font-size: var(--text-3xl);
    }
}

.archive-stats {
    color: #6B7280;
    font-size: var(--text-sm);
}

/* Filter Bar */
.cchub-filters-bar {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    margin-bottom: 2rem;
    padding: 1.25rem;
    background: white;
    border-radius: 20px;
    box-shadow: var(--cchub-shadow-sm);
}

.filter-group {
    flex: 1;
    min-width: 150px;
}

.filter-input,
.filter-select {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1px solid #E5E7EB;
    border-radius: 12px;
    font-size: var(--text-sm);
    font-family: inherit;
    transition: all 0.2s;
}

.filter-input:focus,
.filter-select:focus {
    outline: none;
    border-color: var(--cchub-primary);
    box-shadow: 0 0 0 3px rgba(15, 106, 61, 0.1);
}

/* Listings Grid */
.cchub-listings-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 1.5rem;
    margin-bottom: 3rem;
}

/* No Results */
.no-results {
    text-align: center;
    padding: 3.75rem;
    background: #F9FAFB;
    border-radius: 20px;
    grid-column: 1 / -1;
}

.no-results .emoji {
    font-size: 4rem;
    display: block;
    margin-bottom: 1rem;
}

.no-results h3 {
    font-size: var(--text-xl);
    margin: 0 0 0.5rem;
    color: #1F2937;
}

.no-results p {
    color: #6B7280;
    margin: 0;
}

/* Pagination */
.pagination {
    text-align: center;
    margin: 2.5rem 0;
}

.pagination ul {
    display: inline-flex;
    gap: 0.5rem;
    list-style: none;
    padding: 0;
    margin: 0;
}

.pagination li {
    display: inline-block;
}

.pagination a,
.pagination span {
    display: inline-block;
    padding: 0.625rem 1rem;
    border-radius: 12px;
    text-decoration: none;
    color: #1F2937;
    background: white;
    border: 1px solid #E5E7EB;
    transition: all 0.2s;
    font-size: var(--text-sm);
    font-weight: var(--font-medium);
}

.pagination a:hover {
    background: var(--cchub-primary);
    color: white;
    border-color: var(--cchub-primary);
}

.pagination .current span {
    background: var(--cchub-primary);
    color: white;
    border-color: var(--cchub-primary);
}

/* ========================================
   QUICK TIPS SECTION
   ======================================== */
.cchub-quick-tips {
    background: #FFFBEB;
    border-radius: 16px;
    padding: 1.5rem;
    margin-top: 2rem;
    border: 1px solid #FEF3C7;
}

.cchub-quick-tips h3 {
    color: #D97706;
    margin: 0 0 1rem;
    font-size: var(--text-lg);
    font-weight: var(--font-bold);
}

.cchub-quick-tips ul {
    margin: 0;
    padding-left: 1.25rem;
}

.cchub-quick-tips li {
    margin: 0.5rem 0;
    color: #92400E;
    font-size: var(--text-sm);
}

/* ========================================
   RESPONSIVE UTILITIES
   ======================================== */
@media (max-width: 768px) {
    .hide-on-mobile {
        display: none;
    }
    
    .cchub-details-card {
        padding: 1.25rem;
    }
    
    .cchub-title {
        font-size: var(--text-3xl);
    }
    
    .price,
    .salary {
        font-size: var(--text-2xl);
        padding: 0.375rem 1rem;
    }
    
    .scroll-controls {
        display: none;
    }
    
    .related-job-card,
    .related-car-card {
        flex: 0 0 260px;
    }
    
    .cchub-listings-grid {
        grid-template-columns: 1fr;
    }
    
    .cchub-filters-bar {
        flex-direction: column;
    }
    
    .filter-group {
        min-width: 100%;
    }
}

@media (min-width: 769px) {
    .hide-on-desktop {
        display: none;
    }
}