/**
 * Car Comparison Plugin Styles
 * Optimized for WordPress integration
 */

/* Container Wrapper */
.cc-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
    background-color: #fff;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    line-height: 1.5;
    color: #333;
    box-sizing: border-box;
}

.cc-container *,
.cc-container *::before,
.cc-container *::after {
    box-sizing: border-box;
}

/* Header */
.cc-header {
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid #e0e0e0;
}

.cc-header h1 {
    font-size: 28px;
    font-weight: 600;
    color: #1a1a1a;
    margin: 0;
    padding: 0;
}

/* Navigation Tabs */
.cc-tabs-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 15px 20px;
    background-color: #fff;
    border-bottom: 2px solid #e0e0e0;
    margin: 0 -20px 20px -20px;
    width: calc(100% + 40px);
    transition: box-shadow 0.2s ease;
}

/* Fixed state - applied by JavaScript */
.cc-tabs-nav.cc-fixed {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    width: 100% !important;
    max-width: 100% !important;
    margin: 0 !important;
    padding: 12px 20px !important;
    z-index: 999999 !important;
    background-color: #fff !important;
    box-shadow: 0 4px 15px rgba(0,0,0,0.15) !important;
    border-bottom: 2px solid #0066cc !important;
}

/* Placeholder for fixed nav */
#cc-tabs-placeholder {
    height: 0;
    transition: height 0.1s ease;
}

.cc-tab-btn {
    padding: 10px 20px;
    border: 1px solid #e0e0e0;
    border-radius: 25px;
    background-color: #fff;
    color: #333;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.cc-tab-btn:hover {
    border-color: #0066cc;
    color: #0066cc;
    background-color: #f0f7ff;
}

.cc-tab-btn.active {
    background-color: #0066cc;
    color: #fff;
    border-color: #0066cc;
    box-shadow: 0 2px 8px rgba(0, 102, 204, 0.3);
}

/* Comparison Grid - 2 columns as boxes */
.cc-comparison-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 30px;
    margin-top: 25px;
}

/* Car Column - Box Style */
.cc-car-column {
    background-color: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 16px;
    box-shadow: 0 4px 25px rgba(0, 0, 0, 0.08);
    overflow: hidden;
    transition: box-shadow 0.3s ease, transform 0.3s ease;
}

.cc-car-column:hover {
    box-shadow: 0 8px 40px rgba(0, 0, 0, 0.12);
    transform: translateY(-3px);
}

/* Car Header - STICKY & CENTERED */
.cc-car-header {
    position: sticky;
    top: 60px;
    z-index: 50;
    background-color: #fff;
    padding: 20px 15px;
    border-bottom: 2px solid #0066cc;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
    text-align: center;
}

/* Car Image */
.cc-car-image {
    position: relative;
    margin-bottom: 15px;
    border-radius: 8px;
    overflow: hidden;
}

.cc-car-image img {
    width: 100%;
    height: 180px;
    object-fit: cover;
    display: block;
    transition: transform 0.3s ease;
}

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

.cc-badge {
    position: absolute;
    top: 10px;
    left: 10px;
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
    color: #fff;
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    box-shadow: 0 2px 8px rgba(40, 167, 69, 0.4);
    z-index: 1;
}

.cc-car-header h3 {
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 8px;
    margin-top: 0;
}

.cc-car-header h3 a {
    color: #0066cc;
    text-decoration: none;
}

.cc-car-header h3 a:hover {
    text-decoration: underline;
}

.cc-remove-btn {
    position: absolute;
    top: 15px;
    right: 10px;
    width: 28px;
    height: 28px;
    border: 1px solid #ddd;
    border-radius: 50%;
    background: #fff;
    font-size: 16px;
    color: #999;
    cursor: pointer;
    transition: all 0.2s;
    line-height: 1;
    padding: 0;
}

.cc-remove-btn:hover {
    color: #ff4444;
    border-color: #ff4444;
    background-color: #fff5f5;
}

.cc-car-trim {
    font-size: 14px;
    color: #555;
    margin-bottom: 15px;
    font-weight: 500;
    background-color: #f8f9fa;
    padding: 8px 15px;
    border-radius: 20px;
    display: inline-block;
}

.cc-car-header-actions {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 15px;
    flex-wrap: wrap;
}

.cc-change-style {
    font-size: 13px;
    color: #0066cc;
    text-decoration: none;
    font-weight: 500;
}

.cc-change-style:hover {
    text-decoration: underline;
}

/* Buttons */
.cc-btn-outline {
    padding: 10px 20px;
    background-color: #fff;
    color: #0066cc;
    border: 2px solid #0066cc;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
    display: inline-block;
}

.cc-btn-outline:hover {
    background-color: #0066cc;
    color: #fff;
}

.cc-btn-outline.cc-btn-sm {
    padding: 8px 14px;
    font-size: 12px;
    border-width: 1px;
}

/* Car Section - ALL VISIBLE */
.cc-car-section {
    padding: 20px 15px;
    border-bottom: 1px solid #e0e0e0;
    scroll-margin-top: 140px;
}

.cc-car-section:last-child {
    border-bottom: none;
}

/* Section Title - More Attractive */
.cc-section-title {
    font-size: 16px;
    font-weight: 700;
    margin-bottom: 15px;
    margin-top: 0;
    color: #1a1a1a;
    padding-bottom: 10px;
    border-bottom: 2px solid #0066cc;
    display: inline-block;
}

/* Info Row - IMPROVED STYLING */
.cc-info-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 10px;
    margin: 0 -10px;
    border-radius: 6px;
    transition: background-color 0.2s;
}

.cc-info-row:nth-child(odd) {
    background-color: #f8f9fa;
}

.cc-info-row:hover {
    background-color: #e8f4fd;
}

.cc-info-row .cc-label {
    font-size: 14px;
    color: #555;
    font-weight: 500;
}

.cc-info-row .cc-value {
    font-size: 14px;
    color: #1a1a1a;
    font-weight: 600;
    text-align: right;
}

.cc-info-row .cc-value a {
    color: #0066cc;
    text-decoration: none;
    font-size: 12px;
    font-weight: 500;
}

.cc-info-row .cc-value a:hover {
    text-decoration: underline;
}

/* Overall Rating - Enhanced */
.cc-overall-rating {
    margin-bottom: 20px;
    padding: 15px;
    background: linear-gradient(135deg, #f0f7ff 0%, #e8f4fd 100%);
    border-radius: 10px;
    border: 1px solid #d0e3f7;
}

.cc-rating-label {
    font-size: 14px;
    color: #555;
    display: block;
    margin-bottom: 10px;
    font-weight: 500;
}

.cc-rating-display {
    display: flex;
    align-items: center;
    gap: 10px;
}

.cc-rating-icon {
    font-size: 32px;
}

.cc-rating-number {
    font-size: 42px;
    font-weight: 800;
    color: #0066cc;
    line-height: 1;
}

.cc-rating-max {
    font-size: 18px;
    color: #666;
    font-weight: 500;
}

/* Stars Display */
.cc-stars-display {
    display: flex;
    align-items: center;
    gap: 10px;
}

.cc-stars {
    color: #ffc107;
    font-size: 22px;
    letter-spacing: 2px;
}

.cc-rating-text {
    font-size: 20px;
    font-weight: 700;
    color: #1a1a1a;
}

/* Consumer Rating with Bar Chart */
.cc-consumer-rating-box {
    padding: 5px 0;
}

.cc-consumer-rating-label {
    font-size: 16px;
    font-weight: 700;
    color: #1a1a1a;
    margin-bottom: 10px;
}

.cc-consumer-rating-score {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 20px;
}

.cc-score-number {
    font-size: 24px;
    font-weight: 700;
    color: #1a1a1a;
}

.cc-score-stars {
    font-size: 20px;
    color: #0066cc;
    letter-spacing: 1px;
}

/* Rating Bars */
.cc-rating-bars {
    margin-bottom: 20px;
}

.cc-rating-bar-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
}

.cc-bar-label {
    font-size: 14px;
    font-weight: 600;
    color: #333;
    width: 14px;
    text-align: right;
}

.cc-bar-star {
    font-size: 14px;
    color: #0066cc;
}

.cc-bar-track {
    flex: 1;
    height: 12px;
    background-color: #e0e0e0;
    border-radius: 6px;
    overflow: hidden;
}

.cc-bar-fill {
    height: 100%;
    background-color: #0066cc;
    border-radius: 6px;
    transition: width 0.5s ease;
}

.cc-bar-count {
    font-size: 13px;
    color: #666;
    width: 45px;
    text-align: right;
}

.cc-btn-reviews {
    width: 100%;
    margin-top: 10px;
}

.cc-review-count {
    font-size: 12px;
    color: #666;
    margin-top: 8px;
}

/* Colors Section */
.cc-color-label {
    font-size: 13px;
    color: #666;
    margin: 15px 0 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.cc-color-label:first-of-type {
    margin-top: 0;
}

.cc-color-swatches {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.cc-color-swatch {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    border: none;
}

.cc-color-swatch:hover {
    transform: scale(1.2);
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
}

.cc-color-swatch.selected {
    outline: 3px solid #0066cc;
    outline-offset: 3px;
}


/* Highlight active section */
.cc-car-section.highlight {
    animation: ccHighlightPulse 1s ease-out;
}

@keyframes ccHighlightPulse {
    0% {
        background-color: #e8f4fd;
    }
    100% {
        background-color: transparent;
    }
}

/* Responsive Design */
@media (max-width: 1200px) {
    .cc-comparison-grid {
        gap: 20px;
    }
}

@media (max-width: 768px) {
    .cc-container {
        padding: 10px;
    }

    .cc-header h1 {
        font-size: 18px;
    }

    .cc-tabs-nav {
        gap: 5px;
        overflow-x: auto;
        flex-wrap: nowrap;
        padding: 10px 0;
        -webkit-overflow-scrolling: touch;
    }

    .cc-tab-btn {
        padding: 10px 16px;
        font-size: 13px;
        flex-shrink: 0;
        min-height: 44px;
    }

    /* Keep 2 columns side by side on mobile */
    .cc-comparison-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }

    .cc-car-column {
        border-radius: 10px;
    }

    .cc-car-header {
        padding: 10px;
        top: 50px;
    }

    .cc-car-image img {
        height: 100px;
    }

    .cc-car-header h3 {
        font-size: 14px;
    }

    .cc-car-trim {
        font-size: 9px;
        margin-bottom: 10px;
        padding: 5px 10px;
    }

    .cc-car-header-actions {
        gap: 10px;
    }

    .cc-change-style {
        font-size: 10px;
    }

    .cc-btn-outline.cc-btn-sm {
        padding: 5px 8px;
        font-size: 9px;
    }

    .cc-car-section {
        padding: 12px 10px;
        scroll-margin-top: 70px;
    }

    .cc-section-title {
        font-size: 15px;
        margin-bottom: 12px;
        padding-bottom: 8px;
        font-weight: 700;
    }

    .cc-info-row {
        padding: 10px 8px;
        margin: 0 -5px;
        display: flex;
        flex-direction: column;
        align-items: flex-start;
        gap: 4px;
    }

    .cc-info-row .cc-label {
        font-size: 13px;
        font-weight: 600;
        color: #666;
        width: 100%;
    }

    .cc-info-row .cc-value {
        font-size: 15px;
        font-weight: 700;
        color: #1a1a1a;
        text-align: left;
        width: 100%;
    }

    .cc-overall-rating {
        padding: 10px;
    }

    .cc-rating-number {
        font-size: 28px;
    }

    /* Mobile Rating Bars */
    .cc-consumer-rating-label {
        font-size: 13px;
    }

    .cc-consumer-rating-score {
        gap: 8px;
        margin-bottom: 15px;
    }

    .cc-score-number {
        font-size: 18px;
    }

    .cc-score-stars {
        font-size: 14px;
    }

    .cc-rating-bar-row {
        gap: 5px;
        margin-bottom: 6px;
    }

    .cc-bar-label {
        font-size: 11px;
        width: 12px;
    }

    .cc-bar-star {
        font-size: 11px;
    }

    .cc-bar-track {
        height: 10px;
    }

    .cc-bar-count {
        font-size: 10px;
        width: 35px;
    }

    .cc-btn-reviews {
        font-size: 11px;
        padding: 8px 10px;
    }

    .cc-rating-max {
        font-size: 14px;
    }

    .cc-rating-icon {
        font-size: 20px;
    }

    .cc-stars {
        font-size: 16px;
    }

    .cc-rating-text {
        font-size: 16px;
    }

    .cc-btn-outline {
        padding: 8px 12px;
        font-size: 11px;
    }

    .cc-badge {
        padding: 3px 8px;
        font-size: 10px;
    }

    .cc-remove-btn {
        width: 22px;
        height: 22px;
        font-size: 14px;
        top: 10px;
        right: 5px;
    }

    .cc-color-swatch {
        width: 24px;
        height: 24px;
    }

    .cc-color-label {
        font-size: 11px;
    }
}

@media (max-width: 400px) {
    .cc-comparison-grid {
        gap: 6px;
    }

    .cc-car-column {
        border-radius: 8px;
    }

    .cc-header h1 {
        font-size: 14px;
    }

    .cc-tab-btn {
        padding: 8px 12px;
        font-size: 11px;
        min-height: 40px;
    }

    .cc-car-image img {
        height: 70px;
    }

    .cc-car-header {
        padding: 8px;
    }

    .cc-car-header h3 {
        font-size: 11px;
    }

    .cc-car-trim {
        font-size: 8px;
        padding: 4px 8px;
        margin-bottom: 8px;
    }

    .cc-car-header-actions {
        gap: 8px;
    }

    .cc-change-style {
        font-size: 9px;
    }

    .cc-btn-outline.cc-btn-sm {
        padding: 4px 6px;
        font-size: 8px;
    }

    .cc-info-row .cc-label {
        font-size: 12px;
    }

    .cc-info-row .cc-value {
        font-size: 14px;
    }

    .cc-rating-number {
        font-size: 22px;
    }

    .cc-section-title {
        font-size: 13px;
    }

    .cc-overall-rating {
        padding: 8px;
    }

    .cc-rating-icon {
        font-size: 16px;
    }
}

/* Loading State */
.cc-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 200px;
}

.cc-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid #e0e0e0;
    border-top-color: #0066cc;
    border-radius: 50%;
    animation: ccSpin 1s linear infinite;
}

@keyframes ccSpin {
    to {
        transform: rotate(360deg);
    }
}

/* Empty State */
.cc-empty-state {
    text-align: center;
    padding: 60px 20px;
    color: #666;
}

.cc-empty-state-icon {
    font-size: 48px;
    margin-bottom: 20px;
    opacity: 0.5;
}

.cc-empty-state h3 {
    font-size: 20px;
    margin-bottom: 10px;
    color: #333;
}

.cc-empty-state p {
    font-size: 14px;
    color: #666;
}
