/**
 * Comparison Guide Shortcodes Styles
 *
 * Styling for all comparison guide shortcodes:
 * - Product cards
 * - Comparison table
 * - Product grid
 * - Research stats
 * - Methodology
 * - Sources
 */

/* ==========================================================================
   Product Card - [aopt_product_card]
   ========================================================================== */

.aopt-product-card {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 24px;
    margin: 32px 0;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.aopt-product-card__header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
}

.aopt-product-card__position {
    background: #3b82f6;
    color: #fff;
    font-weight: 700;
    font-size: 18px;
    padding: 8px 16px;
    border-radius: 4px;
    min-width: 48px;
    text-align: center;
}

.aopt-product-card__positioning {
    margin: 0;
    font-size: 20px;
    font-weight: 600;
    color: #1f2937;
    flex: 1;
}

.aopt-product-card__name {
    font-size: 28px;
    font-weight: 700;
    color: #111827;
    margin: 16px 0 8px;
}

.aopt-product-card__tagline {
    color: #6b7280;
    font-size: 16px;
    margin-bottom: 24px;
    line-height: 1.5;
}

.aopt-product-card__image {
    width: 100%;
    max-width: 300px;
    height: auto;
    margin: 0 auto 24px;
    display: block;
}

.aopt-score-badge {
    background: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%);
    color: #fff;
    padding: 24px;
    border-radius: 8px;
    text-align: center;
    margin-bottom: 24px;
}

.aopt-score-badge__number {
    font-size: 48px;
    font-weight: 700;
    line-height: 1;
}

.aopt-score-badge__label {
    font-size: 24px;
    opacity: 0.9;
}

.aopt-score-badge__type {
    display: block;
    font-size: 14px;
    margin-top: 8px;
    opacity: 0.8;
}

.aopt-score-breakdown {
    width: 100%;
    margin-bottom: 24px;
    border-collapse: collapse;
}

.aopt-score-breakdown tr {
    border-bottom: 1px solid #e5e7eb;
}

.aopt-score-breakdown tr:last-child {
    border-bottom: none;
}

.aopt-score-breakdown td {
    padding: 12px 8px;
}

.aopt-score-breakdown__label {
    font-weight: 500;
    color: #374151;
}

.aopt-score-breakdown__score {
    text-align: center;
    font-weight: 700;
    font-size: 18px;
    color: #111827;
    width: 80px;
}

.aopt-score-breakdown__avg {
    text-align: right;
    color: #6b7280;
    font-size: 14px;
    width: 150px;
}

.aopt-score-item {
    padding: 16px 0;
}

.aopt-score-item__header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.aopt-score-item__label {
    font-weight: 500;
    color: #374151;
}

.aopt-score-item__value {
    font-weight: 700;
    font-size: 18px;
    color: #111827;
}

.aopt-score-item__bar {
    height: 8px;
    background: #e5e7eb;
    border-radius: 4px;
    overflow: hidden;
}

.aopt-score-item__bar-fill {
    height: 100%;
    background: linear-gradient(90deg, #3b82f6 0%, #1d4ed8 100%);
    transition: width 0.3s ease;
}

.aopt-product-card__price-cta {
    margin-top: 24px;
}

.aopt-product-card__button {
    display: inline-block;
    width: 100%;
    padding: 16px 24px;
    background: #3b82f6;
    color: #fff;
    text-align: center;
    text-decoration: none;
    font-weight: 600;
    font-size: 16px;
    border-radius: 6px;
    transition: background 0.2s;
}

.aopt-product-card__button:hover {
    background: #2563eb;
    color: #fff;
    text-decoration: none;
}

.aopt-product-card__disclosure {
    font-size: 12px;
    color: #9ca3af;
    text-align: center;
    margin-top: 8px;
}

/* ==========================================================================
   Comparison Table - [aopt_comparison_table]
   ========================================================================== */

.aopt-comparison-table-wrapper {
    margin: 48px 0;
    overflow-x: auto;
}

.aopt-comparison-table-wrapper h2 {
    margin-bottom: 24px;
}

.aopt-comparison-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
    background: #fff;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.aopt-comparison-table thead {
    background: #f9fafb;
}

.aopt-comparison-table th {
    padding: 16px 12px;
    text-align: left;
    font-weight: 600;
    color: #111827;
    border-bottom: 2px solid #e5e7eb;
    vertical-align: top;
}

.aopt-comparison-table th:first-child {
    width: 200px;
}

.aopt-comparison-table__product-header {
    text-align: center !important;
}

.aopt-comparison-table__product-image {
    width: 80px;
    height: 80px;
    object-fit: contain;
    margin: 0 auto 8px;
    display: block;
}

.aopt-comparison-table__product-name {
    font-size: 14px;
    font-weight: 600;
    color: #111827;
    display: block;
}

.aopt-comparison-table td {
    padding: 12px;
    border-bottom: 1px solid #e5e7eb;
    vertical-align: middle;
}

.aopt-comparison-table tr:last-child td {
    border-bottom: none;
}

.aopt-comparison-table__row-label {
    font-weight: 500;
    color: #374151;
}

.aopt-comparison-table__score {
    text-align: center;
    font-weight: 600;
}

.aopt-comparison-table__score--high {
    color: #059669;
}

.aopt-comparison-table__score--medium {
    color: #d97706;
}

.aopt-comparison-table__score--low {
    color: #dc2626;
}

.aopt-comparison-table__button {
    display: inline-block;
    padding: 8px 16px;
    background: #3b82f6;
    color: #fff;
    text-decoration: none;
    border-radius: 4px;
    font-size: 13px;
    font-weight: 500;
}

.aopt-comparison-table__button:hover {
    background: #2563eb;
    color: #fff;
    text-decoration: none;
}

/* ==========================================================================
   Product Grid - [aopt_product_grid]
   ========================================================================== */

.aopt-product-grid {
    margin: 48px 0;
}

.aopt-product-grid h2 {
    margin-bottom: 24px;
}

.aopt-product-grid__items {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 24px;
}

@media (max-width: 768px) {
    .aopt-product-grid__items {
        grid-template-columns: repeat(2, 1fr);
    }
}

.aopt-product-grid__item {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 16px;
    text-align: center;
    text-decoration: none;
    color: inherit;
    transition: transform 0.2s, box-shadow 0.2s;
}

.aopt-product-grid__item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    text-decoration: none;
}

.aopt-product-grid__position {
    background: #3b82f6;
    color: #fff;
    font-weight: 700;
    font-size: 14px;
    padding: 4px 12px;
    border-radius: 4px;
    display: inline-block;
    margin-bottom: 12px;
}

.aopt-product-grid__image {
    width: 100%;
    height: 150px;
    object-fit: contain;
    margin-bottom: 12px;
}

.aopt-product-grid__score {
    font-size: 24px;
    font-weight: 700;
    color: #3b82f6;
    margin-bottom: 8px;
}

.aopt-product-grid__positioning {
    font-size: 13px;
    color: #6b7280;
    margin-bottom: 8px;
    line-height: 1.4;
}

.aopt-product-grid__name {
    font-size: 14px;
    font-weight: 600;
    color: #111827;
    line-height: 1.3;
}

/* ==========================================================================
   Research Stats - [aopt_research_stats]
   ========================================================================== */

.aopt-research-stats {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
    padding: 48px 24px;
    border-radius: 12px;
    margin: 48px 0;
}

.aopt-research-stats__grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 32px;
    max-width: 1200px;
    margin: 0 auto;
}

.aopt-research-stats__item {
    text-align: center;
}

.aopt-research-stats__icon {
    width: 48px;
    height: 48px;
    margin: 0 auto 16px;
}

.aopt-research-stats__number {
    font-size: 48px;
    font-weight: 700;
    line-height: 1;
    margin-bottom: 8px;
    display: block;
}

.aopt-research-stats__label {
    font-size: 16px;
    opacity: 0.9;
    display: block;
}

/* ==========================================================================
   Methodology - [aopt_methodology]
   ========================================================================== */

.aopt-methodology {
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 32px;
    margin: 48px 0;
}

.aopt-methodology h2 {
    margin-top: 0;
    margin-bottom: 16px;
}

.aopt-methodology__intro {
    font-size: 18px;
    color: #374151;
    margin-bottom: 24px;
}

.aopt-methodology__toggle {
    background: #3b82f6;
    color: #fff;
    border: none;
    padding: 12px 24px;
    border-radius: 6px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
    margin-bottom: 24px;
}

.aopt-methodology__toggle:hover {
    background: #2563eb;
}

.aopt-methodology__toggle::after {
    content: ' ▼';
    font-size: 12px;
}

.aopt-methodology__toggle[aria-expanded="true"]::after {
    content: ' ▲';
}

.aopt-methodology__content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
}

.aopt-methodology__content.is-expanded {
    max-height: 2000px;
}

.aopt-methodology__section {
    margin-bottom: 24px;
}

.aopt-methodology__section h3 {
    color: #111827;
    margin-bottom: 8px;
}

.aopt-methodology__section p {
    color: #4b5563;
    line-height: 1.6;
}

.aopt-methodology__note {
    background: #fef3c7;
    border-left: 4px solid #f59e0b;
    padding: 16px;
    margin-top: 24px;
    border-radius: 4px;
}

/* ==========================================================================
   Sources - [aopt_sources]
   ========================================================================== */

.aopt-sources {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 32px;
    margin: 48px 0;
}

.aopt-sources h2 {
    margin-top: 0;
    margin-bottom: 24px;
}

.aopt-sources__section {
    margin-bottom: 32px;
}

.aopt-sources__section:last-child {
    margin-bottom: 0;
}

.aopt-sources__section h3 {
    font-size: 18px;
    color: #111827;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.aopt-sources__icon {
    width: 20px;
    height: 20px;
}

.aopt-sources__list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.aopt-sources__item {
    padding: 12px 0;
    border-bottom: 1px solid #e5e7eb;
}

.aopt-sources__item:last-child {
    border-bottom: none;
}

.aopt-sources__link {
    color: #3b82f6;
    text-decoration: none;
    font-weight: 500;
}

.aopt-sources__link:hover {
    text-decoration: underline;
}

.aopt-sources__link::after {
    content: ' ↗';
    font-size: 12px;
    opacity: 0.6;
}

.aopt-sources__meta {
    color: #6b7280;
    font-size: 14px;
    margin-left: 8px;
}

/* ==========================================================================
   Responsive Adjustments
   ========================================================================== */

@media (max-width: 768px) {
    .aopt-product-card {
        padding: 16px;
    }

    .aopt-product-card__name {
        font-size: 24px;
    }

    .aopt-score-badge__number {
        font-size: 36px;
    }

    .aopt-comparison-table {
        font-size: 12px;
    }

    .aopt-comparison-table th,
    .aopt-comparison-table td {
        padding: 8px 6px;
    }

    .aopt-research-stats {
        padding: 32px 16px;
    }

    .aopt-research-stats__grid {
        gap: 24px;
    }

    .aopt-methodology,
    .aopt-sources {
        padding: 24px 16px;
    }
}

/* ==========================================================================
   Print Styles
   ========================================================================== */

@media print {
    .aopt-product-card__button,
    .aopt-comparison-table__button,
    .aopt-methodology__toggle {
        display: none;
    }

    .aopt-methodology__content {
        max-height: none !important;
    }
}
