/* ===================================
CSS VARIABLES & RESET
=================================== */

:root {
    --background: #f4f7fb;
    --primary-bg-color: var(--background);
    --foreground: #0f172a;
    --border: #e2e8f0;
    --input: #e2e8f0;

    --primary: #0052cc;
    --primary-foreground: #ffffff;
    --secondary: #ebf0f7;
    --secondary-foreground: #1e293b;

    --muted: #f1f5f9;
    --muted-foreground: #64748b;
    --accent: #f1f5f9;
    --accent-foreground: #0f172a;

    --success: #00a76b;
    --success-foreground: #ffffff;
    --destructive: #ef4444;
    --destructive-foreground: #ffffff;
    --warning: #ffb020;
    --warning-foreground: #08121a;

    --card: #ffffff;
    --card-foreground: #0f172a;
    --popover: #ffffff;
    --popover-foreground: #0f172a;

    --sidebar: #eaf3ff;
    --sidebar-foreground: #08315a;
    --sidebar-primary: #d7e8ff;
    --sidebar-primary-foreground: #0057d9;

    --ring: #0052cc;
    --star-color: #f59e0b;

    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 24px;

    --font-family-body: Inter;
}

* {
    box-sizing: border-box;
}


/* ===================================
LAYOUT
=================================== */

:host > div {
    margin: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background-color: var(--background);
    color: var(--foreground);
    display: flex;
    flex-direction: column;
    align-items: center;
    min-height: 100vh;
    padding: 40px 20px;
}

.container {
    width: 100%;
    max-width: 1200px;
    display: flex;
    flex-direction: column;
    gap: 40px;
}

.main-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 40px;
    align-items: start;
}

@media (min-width: 992px) {
    .main-grid {
        grid-template-columns: 340px 1fr;
    }
}

.sidebar,
.content-col {
    min-width: 0;
}


/* ===================================
HEADER
=================================== */

.header-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    text-align: center;
}

.header-overline {
    font-size: 16px;
    color: var(--muted-foreground);
    font-weight: 500;
}

.breadcrumb .breadcrumb-item,
.breadcrumb .breadcrumb-item a {
    font-size: 14px;
    color: var(--muted-foreground);
    font-weight: 500;
}

.header-title {
    font-size: 32px;
    font-weight: 700;
    color: var(--foreground);
}

.header-rating {
    display: flex;
    gap: 8px;
}

.rating-stars {
    display: flex;
    gap: 2px;
}

.rating-text {
    font-size: 14px;
    font-weight: 600;
    color: var(--muted-foreground);
}


/* ===================================
BUTTONS
=================================== */

.btn-v2 {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-md);
    font-weight: 600;
    font-size: 14px;
    padding: 10px 20px;
    cursor: pointer;
    transition: opacity 0.2s, transform 0.1s;
    text-decoration: none;
    white-space: nowrap;
    border: none;
}

.btn-v2:hover {
    opacity: 0.85;
}

.btn-v2:focus {
    outline: 2px solid var(--ring);
    outline-offset: 2px;
}

.btn-v2:active {
    transform: scale(0.97);
}

.btn-v2:disabled,
.btn-v2.disabled {
    cursor: not-allowed;
    opacity: 0.6;
    pointer-events: none;
}

.btn-primary-v2 {
    background-color: var(--primary);
    color: var(--primary-foreground);
}

.btn-primary-v2:hover {
    opacity: 0.85;
    color: var(--primary-foreground);
}

.btn-primary-v2:active {
    opacity: 0.75;
    color: var(--primary-foreground);
}

.btn-outline {
    background-color: transparent;
    border: 1px solid var(--border);
    color: var(--foreground);
}

.btn-outline:hover {
    opacity: 0.85;
}

.btn-outline:active {
    opacity: 0.75;
}

.btn-secondary {
    background-color: var(--secondary);
    color: var(--primary);
}

.btn-secondary:hover {
    opacity: 0.85;
}

.btn-secondary:active {
    opacity: 0.75;
}

.btn-sm-custom {
    border-radius: 20px;
    padding: 6px 16px;
    font-size: 12px;
}

.btn-sm-custom.btn-primary-v2:hover,
.btn-sm-custom.btn-secondary:hover,
.btn-sm-custom.btn-outline:hover {
    transform: scale(1.02);
}

.btn-white {
    background-color: white;
    border: 1px solid var(--border);
    color: var(--muted-foreground);
}

.btn-close {
    border: none;
    cursor: pointer;
    color: var(--muted-foreground);
    padding: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-sm);
    transition: color 0.2s;
}

.vote-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border: 1px solid var(--border);
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    background: transparent;
}


/* ===================================
SIDEBAR
=================================== */

.sidebar {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.sidebar-logo {
    width: 100%;
    max-width: 200px;
    margin: 0 auto;
    display: block;
    object-fit: contain;
}

.info-card {
    background-color: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 20px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
}

.info-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px 16px;
    min-width: 0;
}

@media (min-width: 768px) {
    .info-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

.info-row {
    display: flex;
    align-items: center;
    gap: 12px;
}

.info-icon {
    width: 20px;
    height: 20px;
    object-fit: contain;
    flex-shrink: 0;
}

.info-text {
    font-size: 14px;
    color: var(--foreground);
    line-height: 1.4;
    overflow-wrap: anywhere;
    word-break: break-word;
}

.info-text strong {
    font-weight: 600;
}

.info-box {
    background: #ebf0f7;
    padding: 10px;
    border-radius: 8px;
    font-size: 11px;
    text-align: center;
    color: #333;
}

.tag {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background-color: var(--secondary);
    padding: 6px 10px;
    border-radius: var(--radius-sm);
    font-size: 12px;
    font-weight: 600;
    color: var(--primary);
}

.sidebar-ad {
    width: 100%;
    border-radius: var(--radius-lg);
    overflow: hidden;
}

.sidebar-ad img {
    width: 100%;
    display: block;
}


/* ===================================
CONTENT
=================================== */

.content-col {
    display: flex;
    flex-direction: column;
    gap: 32px;
}

.card {
    background-color: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 32px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.02);
}

.section-title {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 16px;
    color: var(--foreground);
}


/* ===================================
HERO SECTION
=================================== */

.hero-text {
    font-size: 20px;
    line-height: 1.5;
    color: var(--foreground);
    margin-bottom: 24px;
}

.hero-image {
    width: 100%;
    border-radius: var(--radius-md);
    margin-bottom: 24px;
    display: block;
}

.hero-actions {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 16px;
}

@media (min-width: 768px) {
    .hero-actions {
        flex-direction: row;
        align-items: center;
        justify-content: center;
    }
}


/* ===================================
STATS & BADGES
=================================== */

.stats-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}

.stat-box {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.stat-label {
    font-size: 14px;
    font-weight: 600;
    color: var(--foreground);
}

.stat-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 6px 12px;
    border-radius: var(--radius-sm);
    font-weight: 700;
    font-size: 13px;
    color: white;
    width: fit-content;
    white-space: nowrap;
}

.badge-success {
    background-color: #10b981;
}

.badge-warning {
    background-color: #f59e0b;
}

.badge-danger {
    background-color: #ef4444;
}

.stat-desc {
    font-size: 12px;
    color: var(--muted-foreground);
    line-height: 1.5;
}

.stats-row {
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
}

@media (min-width: 768px) {
    .stats-row {
        grid-template-columns: repeat(3, 1fr);
        gap: 20px;
    }
}

.stats-item {
    display: flex;
    align-items: center;
    gap: 10px;
}

.stats-icon {
    width: 24px;
    height: 24px;
    object-fit: contain;
    font-size: 1.3rem;
}

.stats-val {
    font-weight: 600;
    font-size: 14px;
}


/* ===================================
COMPARISON
=================================== */

.comparison-row {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 12px 0;
    border-bottom: 1px solid var(--border);
}

@media (min-width: 768px) {
    .comparison-row {
        flex-direction: row;
        justify-content: space-between;
    }
}

.comparison-row:last-child {
    border-bottom: none;
}

.comparison-label {
    font-weight: 600;
    font-size: 14px;
}

.comparison-value {
    color: var(--muted-foreground);
    font-size: 11px;
    flex: 1;
}


/* ===================================
PROS & CONS
=================================== */

.pros-cons-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 40px;
}

@media (min-width: 768px) {
    .pros-cons-grid {
        grid-template-columns: 1fr 1fr;
    }
}

.pc-col {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.pc-title {
    font-weight: 700;
    font-size: 14px;
    color: #10b981;
    margin-bottom: 8px;
}

.pc-title.cons {
    color: #ef4444;
}

.pc-item {
    font-size: 13px;
    color: var(--muted-foreground);
    line-height: 1.5;
}


/* ===================================
FUNCTIONALITY GRID
=================================== */

.func-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 20px;
}

.func-grid .func-item {
    grid-column: auto;
}

@media (min-width: 768px) {
    .func-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

.func-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
}


/* ===================================
REWARD BOX
=================================== */

.reward-box {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 16px;
    background-color: rgba(0, 82, 204, 0.05);
    border: 1px solid var(--primary);
    border-radius: var(--radius-lg);
    padding: 24px;
}

@media (min-width: 768px) {
    .reward-box {
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
        gap: 0;
    }
}

.reward-content {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.reward-badge {
    background-color: var(--primary);
    color: white;
    font-weight: 700;
    font-size: 12px;
    padding: 6px 12px;
    border-radius: var(--radius-sm);
    width: fit-content;
}

.reward-code {
    text-align: center;
}

.code-box {
    background-color: white;
    border: 2px dashed var(--primary);
    padding: 8px 16px;
    border-radius: var(--radius-md);
    font-family: monospace;
    font-weight: 700;
    color: var(--primary);
    margin-top: 4px;
}


/* ===================================
ARTICLES
=================================== */

.article-list {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.article-item {
    display: flex;
    gap: 16px;
    align-items: flex-start;
}

.article-thumb {
    width: 80px;
    height: 60px;
    background-color: #e2e8f0;
    border-radius: 8px;
    flex-shrink: 0;
    background-size: cover;
    background-position: center;
}

.article-content {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.article-title {
    font-weight: 600;
    font-size: 14px;
    color: var(--foreground);
}

.article-excerpt {
    font-size: 12px;
    color: var(--muted-foreground);
    line-height: 1.4;
}


/* ===================================
INFO BLOCKS
=================================== */

.info-block {
    border-bottom: 1px solid var(--border);
    padding: 16px 0;
}

.info-block:last-child {
    border-bottom: none;
}

.info-block-header {
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 8px;
    font-size: 16px;
}


/* ===================================
RATING BREAKDOWN
=================================== */

.rating-breakdown {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.rating-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    background: var(--secondary);
    border-radius: var(--radius-md);
}

.rating-val-group {
    display: flex;
    align-items: center;
    gap: 12px;
}

.rating-num {
    font-weight: 700;
    font-size: 14px;
}


/* ===================================
REVIEWS
=================================== */

.reviews-section,
.projects-section,
.alternatives-section {
    display: flex;
    flex-direction: column;
    gap: 24px;
    width: 100%;
}

.reviews-header {
    display: flex;
    justify-content: space-between;
    background: var(--card);
    border: 1px solid var(--border);
    padding: 16px 24px;
    border-radius: var(--radius-lg);
}

.review-filters {
    display: flex;
    gap: 24px;
    align-items: center;
}

.review-filters span {
    cursor: pointer;
}

.review-filters span.active {
    color: var(--primary);
}

.review-filters span:not(.active) {
    color: var(--muted-foreground);
}

.filter-group {
    display: flex;
    gap: 12px;
    align-items: center;
}

.review-card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.reviewer-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    object-fit: cover;
}

.review-meta {
    display: flex;
    flex-direction: column;
}

.review-name {
    font-weight: 700;
    font-size: 14px;
}

.review-date {
    font-size: 12px;
    color: var(--muted-foreground);
}

.review-actions {
    display: flex;
    gap: 16px;
    justify-content: flex-end;
}


/* ===================================
PROJECTS
=================================== */

.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 24px;
}

.project-card {
    background: var(--card);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    position: relative;
}

.project-banner {
    height: 140px;
    background-color: #e2e8f0;
    position: relative;
    padding: 16px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    align-items: flex-end;
    background-size: cover;
    background-position: center;
}

.project-badge {
    background: white;
    padding: 4px 8px;
    border-radius: var(--radius-sm);
    font-size: 12px;
    font-weight: 700;
    display: flex;
    gap: 6px;
    align-items: center;
}

.project-logo-float {
    position: absolute;
    bottom: -20px;
    left: 20px;
    width: 64px;
    height: 64px;
    border-radius: 12px;
    background: white;
    border: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
}

.project-title {
    font-size: 18px;
    font-weight: 700;
    text-align: center;
    margin-bottom: 8px;
}

.project-meta-row {
    display: flex;
    justify-content: space-between;
    font-size: 13px;
    color: var(--muted-foreground);
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border);
}

.project-desc {
    font-size: 13px;
    line-height: 1.4;
    color: var(--muted-foreground);
    height: 40px;
    overflow: hidden;
}

.progress-section {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.progress-labels {
    display: flex;
    justify-content: space-between;
    font-weight: 700;
    font-size: 12px;
}

.progress-bar-bg {
    width: 100%;
    height: 24px;
    background: #ebf0f7;
    border-radius: 12px;
    overflow: hidden;
    position: relative;
}

.progress-bar-fill {
    height: 100%;
    background: var(--primary);
    display: flex;
    align-items: center;
    justify-content: flex-end;
    padding-right: 8px;
    color: white;
    font-size: 12px;
    font-weight: 700;
}

.stats-footer {
    display: grid;
    grid-template-columns: 1fr 1fr;
    border-top: 1px solid var(--border);
}

.sf-item {
    padding: 12px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    border-right: 1px solid var(--border);
}

.sf-item:last-child {
    border-right: none;
}

.sf-label {
    font-size: 12px;
    font-weight: 600;
    color: var(--muted-foreground);
}

.sf-val {
    font-size: 14px;
    font-weight: 700;
    color: var(--foreground);
}


/* ===================================
ALTERNATIVES
=================================== */

.alt-card {
    background: var(--card);
    padding: 24px;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    gap: 20px;
    text-align: center;
}

.alt-header {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
}

.alt-logo {
    width: 80px;
    height: 80px;
    object-fit: contain;
}

.alt-name {
    font-size: 18px;
    font-weight: 700;
    color: var(--primary);
}

.alt-details {
    background: var(--secondary);
    border-radius: var(--radius-md);
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.alt-row {
    display: flex;
    justify-content: space-between;
    font-size: 13px;
}


/* ===================================
MODAL
=================================== */

.modal-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(15, 23, 42, 0.7);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    z-index: 50;
    overflow-y: auto;
}

.modal-card {
    background-color: var(--card);
    width: 100%;
    max-width: 540px;
    max-height: 90%;
    border-radius: var(--radius-lg);
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    display: flex;
    flex-direction: column;
    animation: fadeIn 0.2s ease-out;
    overflow: hidden;
}

.modal-header {
    padding: 24px 32px;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-title {
    font-size: 20px;
    font-weight: 700;
    color: var(--foreground);
}

.modal-body {
    padding: 32px;
    display: flex;
    flex-direction: column;
    gap: 28px;
    overflow-y: scroll;
    min-height: 50vh;
}

.modal-footer {
    padding: 24px 32px;
    border-top: 1px solid var(--border);
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    background-color: var(--background);
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: scale(0.98);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}


/* ===================================
MODAL RATING SECTION
=================================== */

.main-rating {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
}

.rating-label {
    font-size: 14px;
    font-weight: 600;
    color: var(--muted-foreground);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.star-group {
    display: flex;
    gap: 8px;
}

.star-group-large .star-icon {
    font-size: 32px;
    color: var(--input);
    cursor: pointer;
    transition: color 0.2s;
}

.star-group-large .star-icon.active {
    color: var(--star-color);
}

.detailed-ratings {
    display: grid;
    grid-template-columns: 1fr;
    gap: 16px;
    background-color: var(--secondary);
    padding: 20px;
    border-radius: var(--radius-md);
}

.row-label {
    font-size: 14px;
    font-weight: 500;
    color: var(--foreground);
}

.star-group-small {
    display: flex;
    gap: 4px;
}

.star-group-small .star-icon {
    font-size: 18px;
    color: #cbd5e1;
    cursor: pointer;
}

.star-group-small .star-icon.filled {
    color: var(--star-color);
}


/* ===================================
FORM ELEMENTS
=================================== */

.form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.form-label {
    font-size: 14px;
    font-weight: 600;
    color: var(--foreground);
}

.text-input {
    padding: 12px 16px;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    font-size: 14px;
    color: var(--foreground);
    background: var(--background);
    outline: none;
}

.textarea-input {
    padding: 12px 16px;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    font-size: 14px;
    color: var(--foreground);
    background: var(--background);
    outline: none;
    min-height: 100px;
    resize: none;
    font-family: inherit;
}

.helper-text {
    font-size: 12px;
    color: var(--muted-foreground);
}

.richtext *:not(:has(:not(:empty))) {
    margin: 0;
    padding: 0;
}
