/**
 * Titan Reviews - Main Stylesheet
 * Mobile-first responsive design with dark mode support
 */

/* ==========================================================================
   CSS Variables
   ========================================================================== */

:root {
    --titan-primary: #2563eb;
    --titan-secondary: #10b981;
    --titan-green: #10b981;
    --titan-orange: #f59e0b;
    --titan-red: #ef4444;
    --titan-bg: #ffffff;
    --titan-bg-alt: #f8fafc;
    --titan-border: #e2e8f0;
    --titan-text: #1e293b;
    --titan-text-muted: #64748b;
    --titan-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --titan-shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --titan-radius: 12px;
    --titan-radius-sm: 8px;
    --titan-transition: all 0.3s ease;
}

/* Dark mode */
@media (prefers-color-scheme: dark) {
    :root {
        --titan-bg: #1e293b;
        --titan-bg-alt: #0f172a;
        --titan-border: #334155;
        --titan-text: #f1f5f9;
        --titan-text-muted: #94a3b8;
        --titan-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.3), 0 2px 4px -1px rgba(0, 0, 0, 0.2);
    }
}

/* ==========================================================================
   Review Box
   ========================================================================== */

.titan-review-box {
    background: var(--titan-bg);
    border: 1px solid var(--titan-border);
    border-radius: var(--titan-radius);
    box-shadow: var(--titan-shadow);
    margin: 1.5rem 0;
    overflow: hidden;
    transition: var(--titan-transition);
}

.titan-review-box:hover {
    box-shadow: var(--titan-shadow-lg);
}

.titan-review-header {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    padding: 1.5rem;
    background: var(--titan-bg-alt);
    border-bottom: 1px solid var(--titan-border);
}

@media (min-width: 640px) {
    .titan-review-header {
        flex-direction: row;
        align-items: center;
    }
}

.titan-review-image {
    flex-shrink: 0;
}

.titan-review-image img {
    width: 100%;
    max-width: 120px;
    height: auto;
    border-radius: var(--titan-radius-sm);
    object-fit: cover;
}

.titan-review-title-score {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    flex: 1;
}

@media (min-width: 640px) {
    .titan-review-title-score {
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
    }
}

.titan-review-title {
    margin: 0;
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--titan-text);
}

/* Score Circle */
.titan-score-circle {
    position: relative;
    width: 80px;
    height: 80px;
    flex-shrink: 0;
}

.titan-score-svg {
    width: 100%;
    height: 100%;
    transform: rotate(-90deg);
}

.titan-score-bg {
    fill: none;
    stroke: var(--titan-border);
    stroke-width: 8;
}

.titan-score-progress {
    fill: none;
    stroke-width: 8;
    stroke-linecap: round;
    transition: stroke-dashoffset 1s ease-out;
}

.titan-score-green .titan-score-progress {
    stroke: var(--titan-green);
}

.titan-score-orange .titan-score-progress {
    stroke: var(--titan-orange);
}

.titan-score-red .titan-score-progress {
    stroke: var(--titan-red);
}

.titan-score-value {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--titan-text);
}

/* Review Content */
.titan-review-content {
    padding: 1.5rem;
}

.titan-review-proscons {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.5rem;
    margin-bottom: 1.5rem;
}

@media (min-width: 640px) {
    .titan-review-proscons {
        grid-template-columns: 1fr 1fr;
    }
}

.titan-proscons-title {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin: 0 0 0.75rem;
    font-size: 1rem;
    font-weight: 600;
}

.titan-pros-title {
    color: var(--titan-green);
}

.titan-cons-title {
    color: var(--titan-red);
}

.titan-icon {
    width: 1.25rem;
    height: 1.25rem;
}

.titan-proscons-list {
    margin: 0;
    padding: 0;
    list-style: none;
}

.titan-proscons-list li {
    position: relative;
    padding: 0.375rem 0 0.375rem 1.5rem;
    color: var(--titan-text);
    font-size: 0.9375rem;
}

.titan-review-pros .titan-proscons-list li::before {
    content: "\2713";
    position: absolute;
    left: 0;
    color: var(--titan-green);
    font-weight: 700;
}

.titan-review-cons .titan-proscons-list li::before {
    content: "\2717";
    position: absolute;
    left: 0;
    color: var(--titan-red);
    font-weight: 700;
}

/* Verdict */
.titan-review-verdict {
    background: var(--titan-bg-alt);
    padding: 1rem 1.25rem;
    border-radius: var(--titan-radius-sm);
    margin-bottom: 1.5rem;
    font-size: 0.9375rem;
    color: var(--titan-text);
    border-left: 4px solid var(--titan-primary);
}

.titan-review-verdict strong {
    color: var(--titan-primary);
    margin-right: 0.5rem;
}

/* CTA Button */
.titan-review-cta {
    margin-top: 1rem;
}

.titan-cta-left {
    text-align: left;
}

.titan-cta-center {
    text-align: center;
}

.titan-cta-right {
    text-align: right;
}

.titan-cta-button {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.875rem 2rem;
    background: var(--titan-primary);
    color: #ffffff !important;
    font-size: 1rem;
    font-weight: 600;
    text-decoration: none !important;
    border-radius: var(--titan-radius-sm);
    transition: var(--titan-transition);
    box-shadow: 0 2px 4px rgba(37, 99, 235, 0.2);
}

.titan-cta-button:hover {
    background: #1d4ed8;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(37, 99, 235, 0.3);
    color: #ffffff !important;
}

.titan-cta-arrow {
    width: 1.25rem;
    height: 1.25rem;
    transition: transform 0.2s ease;
}

.titan-cta-button:hover .titan-cta-arrow {
    transform: translateX(4px);
}

/* ==========================================================================
   Comparison Table
   ========================================================================== */

.titan-compare-wrapper {
    margin: 1.5rem 0;
}

.titan-compare-table-container {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    border-radius: var(--titan-radius);
    box-shadow: var(--titan-shadow);
}

.titan-compare-table {
    width: 100%;
    min-width: 500px;
    border-collapse: collapse;
    background: var(--titan-bg);
}

.titan-compare-table th,
.titan-compare-table td {
    padding: 1rem;
    text-align: center;
    border-bottom: 1px solid var(--titan-border);
}

.titan-compare-header-empty {
    background: var(--titan-bg-alt);
    width: 150px;
}

.titan-compare-product-header {
    background: var(--titan-bg-alt);
    position: relative;
    min-width: 150px;
}

.titan-best-product {
    background: linear-gradient(135deg, var(--titan-primary), #1d4ed8);
}

.titan-best-badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    background: var(--titan-secondary);
    color: #ffffff;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border-radius: 9999px;
    margin-bottom: 0.5rem;
}

.titan-product-name {
    display: block;
    font-size: 1rem;
    font-weight: 700;
    color: var(--titan-text);
}

.titan-best-product .titan-product-name {
    color: #ffffff;
}

.titan-compare-label {
    text-align: left;
    font-weight: 600;
    color: var(--titan-text);
    background: var(--titan-bg-alt);
}

.titan-compare-value {
    color: var(--titan-text);
}

.titan-best-column {
    background: rgba(37, 99, 235, 0.05);
}

.titan-price {
    font-size: 1.125rem;
    font-weight: 700;
    color: var(--titan-primary);
}

.titan-compare-score {
    display: inline-block;
    padding: 0.375rem 0.75rem;
    border-radius: var(--titan-radius-sm);
    font-weight: 700;
    font-size: 0.9375rem;
}

.titan-compare-score.titan-score-green {
    background: rgba(16, 185, 129, 0.15);
    color: var(--titan-green);
}

.titan-compare-score.titan-score-orange {
    background: rgba(245, 158, 11, 0.15);
    color: var(--titan-orange);
}

.titan-compare-score.titan-score-red {
    background: rgba(239, 68, 68, 0.15);
    color: var(--titan-red);
}

.titan-feature-yes,
.titan-feature-no {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.5rem;
    height: 1.5rem;
}

.titan-feature-yes svg {
    color: var(--titan-green);
}

.titan-feature-no svg {
    color: var(--titan-red);
}

.titan-compare-cta-row td {
    padding: 1.25rem 1rem;
}

.titan-compare-cta {
    display: inline-block;
    padding: 0.625rem 1.5rem;
    font-size: 0.875rem;
    font-weight: 600;
    text-decoration: none !important;
    border-radius: var(--titan-radius-sm);
    transition: var(--titan-transition);
}

.titan-cta-primary {
    background: var(--titan-primary);
    color: #ffffff !important;
}

.titan-cta-primary:hover {
    background: #1d4ed8;
    color: #ffffff !important;
}

.titan-cta-secondary {
    background: var(--titan-bg-alt);
    color: var(--titan-text) !important;
    border: 1px solid var(--titan-border);
}

.titan-cta-secondary:hover {
    background: var(--titan-border);
    color: var(--titan-text) !important;
}

/* ==========================================================================
   VS Widget
   ========================================================================== */

.titan-vs-widget {
    background: var(--titan-bg);
    border: 1px solid var(--titan-border);
    border-radius: var(--titan-radius);
    box-shadow: var(--titan-shadow);
    margin: 1.5rem 0;
    overflow: hidden;
}

.titan-vs-container {
    display: flex;
    flex-direction: column;
    position: relative;
}

@media (min-width: 640px) {
    .titan-vs-container {
        flex-direction: row;
    }
}

.titan-vs-product {
    flex: 1;
    padding: 2rem 1.5rem;
    text-align: center;
    position: relative;
    background: var(--titan-bg);
    transition: var(--titan-transition);
}

.titan-vs-product:first-child {
    border-bottom: 1px solid var(--titan-border);
}

@media (min-width: 640px) {
    .titan-vs-product:first-child {
        border-bottom: none;
        border-right: 1px solid var(--titan-border);
    }
}

.titan-vs-winner {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.1), rgba(16, 185, 129, 0.05));
}

.titan-winner-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.375rem 1rem;
    background: var(--titan-secondary);
    color: #ffffff;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    border-radius: 9999px;
    margin-bottom: 1rem;
}

.titan-winner-badge svg {
    width: 1rem;
    height: 1rem;
}

.titan-vs-product-name {
    margin: 0 0 1rem;
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--titan-text);
}

.titan-vs-score {
    display: inline-flex;
    align-items: baseline;
    gap: 0.125rem;
    padding: 0.5rem 1.25rem;
    border-radius: var(--titan-radius-sm);
}

.titan-vs-score.titan-score-green {
    background: rgba(16, 185, 129, 0.15);
}

.titan-vs-score.titan-score-orange {
    background: rgba(245, 158, 11, 0.15);
}

.titan-vs-score.titan-score-red {
    background: rgba(239, 68, 68, 0.15);
}

.titan-vs-score-value {
    font-size: 2rem;
    font-weight: 700;
}

.titan-score-green .titan-vs-score-value {
    color: var(--titan-green);
}

.titan-score-orange .titan-vs-score-value {
    color: var(--titan-orange);
}

.titan-score-red .titan-vs-score-value {
    color: var(--titan-red);
}

.titan-vs-score-max {
    font-size: 1rem;
    color: var(--titan-text-muted);
    font-weight: 500;
}

/* VS Badge */
.titan-vs-badge {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 10;
    width: 3.5rem;
    height: 3.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--titan-primary);
    color: #ffffff;
    font-size: 1rem;
    font-weight: 700;
    border-radius: 50%;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
}

/* Summary */
.titan-vs-summary {
    padding: 1.25rem 1.5rem;
    background: var(--titan-bg-alt);
    border-top: 1px solid var(--titan-border);
}

.titan-vs-summary p {
    margin: 0;
    color: var(--titan-text);
    font-size: 0.9375rem;
    text-align: center;
}

/* ==========================================================================
   Pros/Cons Block
   ========================================================================== */

.titan-proscons {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.5rem;
    margin: 1.5rem 0;
}

@media (min-width: 640px) {
    .titan-proscons {
        grid-template-columns: 1fr 1fr;
    }
}

.titan-proscons-column {
    padding: 1.5rem;
    border-radius: var(--titan-radius);
    box-shadow: var(--titan-shadow);
}

.titan-pros {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.08), rgba(16, 185, 129, 0.02));
    border: 1px solid rgba(16, 185, 129, 0.2);
}

.titan-cons {
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.08), rgba(239, 68, 68, 0.02));
    border: 1px solid rgba(239, 68, 68, 0.2);
}

.titan-proscons-heading {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin: 0 0 1rem;
    font-size: 1.125rem;
    font-weight: 700;
}

.titan-pros .titan-proscons-heading {
    color: var(--titan-green);
}

.titan-cons .titan-proscons-heading {
    color: var(--titan-red);
}

.titan-proscons-heading .titan-icon {
    width: 1.5rem;
    height: 1.5rem;
}

.titan-proscons-items {
    margin: 0;
    padding: 0;
    list-style: none;
}

.titan-proscons-item {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 0.5rem 0;
    color: var(--titan-text);
    font-size: 0.9375rem;
}

.titan-check-icon,
.titan-x-icon {
    width: 1.25rem;
    height: 1.25rem;
    flex-shrink: 0;
    margin-top: 0.125rem;
}

.titan-pro-item .titan-check-icon {
    color: var(--titan-green);
}

.titan-con-item .titan-x-icon {
    color: var(--titan-red);
}

/* ==========================================================================
   Animations
   ========================================================================== */

@keyframes titan-fade-in {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.titan-review-box,
.titan-compare-wrapper,
.titan-vs-widget,
.titan-proscons {
    animation: titan-fade-in 0.4s ease-out;
}

/* Score circle animation on scroll */
.titan-score-progress {
    stroke-dashoffset: 251.2 !important;
}

.titan-score-progress.titan-animated {
    stroke-dashoffset: var(--target-offset) !important;
}

/* ==========================================================================
   Sticky CTA Widget (Sidebar)
   ========================================================================== */

.titan-sticky-cta {
    position: sticky;
    top: 100px;
    background: var(--titan-bg);
    border: 2px solid var(--titan-primary);
    border-radius: var(--titan-radius);
    box-shadow: var(--titan-shadow-lg);
    padding: 1.5rem;
    text-align: center;
    z-index: 100;
}

.titan-sticky-badge {
    display: inline-block;
    padding: 0.375rem 1rem;
    background: linear-gradient(135deg, var(--titan-primary), #1d4ed8);
    color: #ffffff;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    border-radius: 9999px;
    margin-bottom: 1rem;
}

.titan-sticky-title {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--titan-text-muted);
    margin-bottom: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.titan-sticky-image {
    margin-bottom: 1rem;
}

.titan-sticky-image img {
    max-width: 100px;
    height: auto;
    border-radius: var(--titan-radius-sm);
}

.titan-sticky-product {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--titan-text);
    margin-bottom: 0.75rem;
    line-height: 1.3;
}

.titan-sticky-rating {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.titan-sticky-stars {
    display: flex;
    gap: 0.125rem;
}

.titan-star-icon {
    width: 1rem;
    height: 1rem;
    color: #fbbf24;
}

.titan-star-half {
    opacity: 0.5;
}

.titan-sticky-rating-value {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--titan-text);
}

.titan-sticky-features {
    list-style: none;
    padding: 0;
    margin: 0 0 1.25rem;
    text-align: left;
}

.titan-sticky-features li {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.375rem 0;
    font-size: 0.875rem;
    color: var(--titan-text);
}

.titan-sticky-features .titan-check {
    width: 1rem;
    height: 1rem;
    color: var(--titan-green);
    flex-shrink: 0;
}

.titan-sticky-price {
    margin-bottom: 1rem;
}

.titan-sticky-old-price {
    font-size: 0.875rem;
    color: var(--titan-text-muted);
    text-decoration: line-through;
    margin-right: 0.5rem;
}

.titan-sticky-current-price {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--titan-primary);
}

.titan-sticky-button {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    width: 100%;
    padding: 1rem 1.5rem;
    background: linear-gradient(135deg, var(--titan-primary), #1d4ed8);
    color: #ffffff !important;
    font-size: 1rem;
    font-weight: 700;
    text-decoration: none !important;
    border-radius: var(--titan-radius-sm);
    transition: var(--titan-transition);
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
}

.titan-sticky-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(37, 99, 235, 0.4);
    color: #ffffff !important;
}

.titan-sticky-button svg {
    width: 1.25rem;
    height: 1.25rem;
    transition: transform 0.2s ease;
}

.titan-sticky-button:hover svg {
    transform: translateX(4px);
}

.titan-sticky-trust {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.375rem;
    margin-top: 1rem;
    font-size: 0.75rem;
    color: var(--titan-text-muted);
}

.titan-sticky-trust svg {
    color: var(--titan-green);
}

/* Pulse animation for urgency */
@keyframes titan-pulse {
    0%, 100% {
        box-shadow: 0 0 0 0 rgba(37, 99, 235, 0.4);
    }
    50% {
        box-shadow: 0 0 0 8px rgba(37, 99, 235, 0);
    }
}

.titan-sticky-cta:hover {
    animation: titan-pulse 2s infinite;
}

/* Mobile: sidebar widget not sticky */
@media (max-width: 1024px) {
    .titan-sticky-cta {
        position: relative;
        top: 0;
    }
}

/* ==========================================================================
   Mobile Fixed CTA (Bottom Bar)
   ========================================================================== */

.titan-mobile-cta {
    display: none;
}

@media (max-width: 1024px) {
    .titan-mobile-cta {
        display: flex;
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        z-index: 9999;
        background: var(--titan-bg);
        border-top: 1px solid var(--titan-border);
        box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.15);
        padding: 0.75rem 1rem;
        align-items: center;
        gap: 0.75rem;
        animation: titan-slide-up 0.3s ease-out;
    }

    .titan-mobile-cta-info {
        flex: 1;
        min-width: 0;
    }

    .titan-mobile-cta-product {
        font-size: 0.875rem;
        font-weight: 700;
        color: var(--titan-text);
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        margin-bottom: 0.125rem;
    }

    .titan-mobile-cta-price {
        display: flex;
        align-items: center;
        gap: 0.375rem;
    }

    .titan-mobile-cta-old {
        font-size: 0.75rem;
        color: var(--titan-text-muted);
        text-decoration: line-through;
    }

    .titan-mobile-cta-current {
        font-size: 1rem;
        font-weight: 700;
        color: var(--titan-primary);
    }

    .titan-mobile-cta-rating {
        display: flex;
        align-items: center;
        gap: 0.25rem;
        font-size: 0.75rem;
        color: var(--titan-text-muted);
    }

    .titan-mobile-cta-rating svg {
        width: 0.875rem;
        height: 0.875rem;
        color: #fbbf24;
    }

    .titan-mobile-cta-button {
        flex-shrink: 0;
        padding: 0.75rem 1.25rem;
        background: linear-gradient(135deg, var(--titan-primary), #1d4ed8);
        color: #ffffff !important;
        font-size: 0.875rem;
        font-weight: 700;
        text-decoration: none !important;
        border-radius: var(--titan-radius-sm);
        white-space: nowrap;
        box-shadow: 0 2px 8px rgba(37, 99, 235, 0.3);
    }

    .titan-mobile-cta-button:hover,
    .titan-mobile-cta-button:active {
        background: #1d4ed8;
        color: #ffffff !important;
    }

    /* Add padding to body to prevent content hidden by fixed CTA */
    body.has-titan-mobile-cta {
        padding-bottom: 80px;
    }
}

@keyframes titan-slide-up {
    from {
        transform: translateY(100%);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

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

@media print {
    .titan-review-box,
    .titan-compare-wrapper,
    .titan-vs-widget,
    .titan-proscons {
        box-shadow: none;
        border: 1px solid #ccc;
    }

    .titan-cta-button,
    .titan-compare-cta {
        background: none !important;
        color: #000 !important;
        border: 1px solid #000;
    }
}
