/* ============================================================
   Component Styles
   Buttons, cards, tables, forms, code blocks, and all
   reusable UI component patterns.
   ============================================================ */

/* ---- Buttons ---- */

.btn {
    padding: 1rem 2rem;
    border-radius: 8px;
    font-weight: 600;
    text-decoration: none;
    transition: all .25s;
    font-size: 1rem;
    display: inline-flex;
    align-items: center;
    gap: .5rem;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: #fff;
    box-shadow: 0 4px 20px rgba(37, 99, 235, .35);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 30px rgba(37, 99, 235, .45);
}

.btn-secondary {
    background: rgba(255, 255, 255, .08);
    color: #fff;
    border: 1.5px solid rgba(255, 255, 255, .2);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, .15);
    border-color: rgba(255, 255, 255, .35);
}

/* ---- Language Switcher ---- */

.lang-switcher {
    position: relative;
    margin-left: .75rem;
}

.lang-btn {
    background: rgba(255, 255, 255, .06);
    border: 1px solid rgba(255, 255, 255, .12);
    color: #fff;
    padding: .4rem .75rem;
    border-radius: 6px;
    cursor: pointer;
    font-size: .8rem;
    display: flex;
    align-items: center;
    gap: .4rem;
    transition: all .2s;
}

.lang-btn:hover {
    background: rgba(255, 255, 255, .12);
}

.lang-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: .4rem;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, .25);
    overflow: hidden;
    display: none;
    min-width: 120px;
}

.lang-dropdown.show {
    display: block;
}

.lang-option {
    display: block;
    width: 100%;
    padding: .65rem 1rem;
    background: none;
    border: none;
    text-align: left;
    cursor: pointer;
    color: var(--text);
    font-size: .85rem;
    transition: background .15s;
}

.lang-option:hover {
    background: var(--bg-light);
}

.lang-option.active {
    background: var(--primary);
    color: #fff;
}

/* ---- Cost Comparison Table ---- */

.comparison-box {
    background: rgba(255, 255, 255, .05);
    border-radius: 16px;
    padding: 2rem;
    border: 1px solid rgba(255, 255, 255, .1);
    overflow-x: auto;
}

.comparison-table {
    width: 100%;
    border-collapse: collapse;
    font-size: .9rem;
    min-width: 650px;
}

.comparison-table th {
    text-align: left;
    padding: .75rem;
    color: rgba(255, 255, 255, .7);
    font-weight: 600;
    border-bottom: 2px solid rgba(255, 255, 255, .15);
    white-space: nowrap;
}

.comparison-table td {
    padding: .6rem .75rem;
    border-bottom: 1px solid rgba(255, 255, 255, .08);
    color: rgba(255, 255, 255, .9);
}

.comparison-table tr:hover td {
    background: rgba(59, 130, 246, .15);
}

.comparison-table .savings {
    color: #34d399;
    font-weight: 700;
}

.comparison-table .provider-cn {
    color: #34d399;
    font-size: .75rem;
    display: block;
}

.comparison-table .provider-us {
    color: var(--accent);
    font-size: .75rem;
    display: block;
}

/* ---- Problem Cards ---- */

.problem-card {
    padding: 2rem;
    border-radius: 12px;
    background: var(--bg-light);
    border: 1px solid var(--border);
    transition: all .3s;
}

.problem-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 30px rgba(0, 0, 0, .08);
}

.problem-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1rem;
    font-size: 1.4rem;
}

.problem-icon.cost {
    background: rgba(239, 68, 68, .1);
}

.problem-icon.access {
    background: rgba(245, 158, 11, .1);
}

.problem-icon.lockin {
    background: rgba(99, 102, 241, .1);
}

.problem-icon.complex {
    background: rgba(6, 182, 212, .1);
}

.problem-card h3 {
    color: var(--secondary);
    margin-bottom: .5rem;
    font-size: 1.1rem;
}

.problem-card p {
    color: var(--text-light);
    font-size: .92rem;
    line-height: 1.6;
}

/* ---- Solution Cards ---- */

.solution-card {
    background: #fff;
    border-radius: 16px;
    padding: 2.5rem;
    box-shadow: 0 4px 20px rgba(0, 0, 0, .04);
    border: 1px solid var(--border);
    transition: all .3s;
}

.solution-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 16px 40px rgba(0, 0, 0, .08);
}

.solution-icon {
    width: 56px;
    height: 56px;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1.25rem;
    font-size: 1.5rem;
}

.solution-card h3 {
    font-size: 1.3rem;
    color: var(--secondary);
    margin-bottom: .75rem;
}

.solution-card > p {
    color: var(--text-light);
    margin-bottom: 1.25rem;
    font-size: .95rem;
}

.solution-features {
    list-style: none;
}

.solution-features li {
    padding: .5rem 0;
    color: var(--text);
    display: flex;
    align-items: center;
    gap: .6rem;
    font-size: .9rem;
}

.solution-features li::before {
    content: '\2713';
    color: var(--success);
    font-weight: bold;
    font-size: 1rem;
}

/* ---- API Compatibility ---- */

.api-compat-box {
    background: linear-gradient(135deg, #f0f9ff, #e0f2fe);
    border-radius: 16px;
    padding: 3rem;
    border: 1px solid #bae6fd;
    text-align: center;
    max-width: 800px;
    margin: 0 auto;
}

.api-compat-box h3 {
    font-size: 1.8rem;
    color: var(--secondary);
    margin-bottom: 1rem;
}

.api-compat-box p {
    color: var(--text);
    margin-bottom: 1.5rem;
    font-size: 1.05rem;
}

.api-code-block {
    background: var(--secondary);
    border-radius: 12px;
    padding: 1.5rem;
    text-align: left;
    margin: 1.5rem auto;
    max-width: 500px;
    overflow-x: auto;
}

.api-code-block code {
    color: #e2e8f0;
    font-family: 'SF Mono', 'Fira Code', monospace;
    font-size: .85rem;
    line-height: 1.7;
}

.api-code-block .comment {
    color: #64748b;
}

.api-code-block .keyword {
    color: #60a5fa;
}

.api-code-block .string {
    color: #34d399;
}

.api-compat-features {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    margin-top: 2rem;
}

.api-compat-feat {
    padding: 1rem;
    background: #fff;
    border-radius: 10px;
    border: 1px solid var(--border);
}

.api-compat-feat h4 {
    color: var(--secondary);
    margin-bottom: .25rem;
    font-size: 1rem;
}

.api-compat-feat p {
    color: var(--text-light);
    font-size: .9rem;
    margin: 0;
}

/* ---- Model Cards ---- */

.model-card {
    background: rgba(255, 255, 255, .04);
    border: 1px solid rgba(255, 255, 255, .08);
    border-radius: 12px;
    padding: 1.5rem;
    transition: all .25s;
}

.model-card:hover {
    background: rgba(255, 255, 255, .08);
    border-color: var(--primary);
    transform: translateY(-3px);
}

.model-name {
    font-size: 1.15rem;
    font-weight: 600;
    margin-bottom: .15rem;
    color: #fff;
}

.model-provider {
    font-size: .8rem;
    color: rgba(255, 255, 255, .5);
    margin-bottom: .75rem;
}

.model-desc {
    font-size: .88rem;
    color: rgba(255, 255, 255, .75);
    margin-bottom: .75rem;
}

.model-tags {
    display: flex;
    gap: .4rem;
    flex-wrap: wrap;
}

.model-tag {
    display: inline-block;
    padding: .2rem .65rem;
    border-radius: 12px;
    font-size: .7rem;
    font-weight: 600;
}

.model-tag.benchmark {
    background: rgba(16, 185, 129, .15);
    color: #34d399;
}

.model-tag.savings {
    background: rgba(37, 99, 235, .15);
    color: #60a5fa;
}

.model-tag.capability {
    background: rgba(6, 182, 212, .15);
    color: #22d3ee;
}

/* ---- Savings Banner ---- */

.savings-banner {
    background: linear-gradient(135deg, rgba(16, 185, 129, .08), rgba(37, 99, 235, .08));
    border: 1px solid rgba(16, 185, 129, .2);
    border-radius: 16px;
    padding: 2rem;
    text-align: center;
    margin-bottom: 3rem;
}

.savings-banner h3 {
    font-size: 1.5rem;
    color: var(--secondary);
    margin-bottom: .5rem;
}

.savings-banner .amount {
    font-size: 2.75rem;
    font-weight: 800;
    background: linear-gradient(135deg, var(--success), var(--primary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.savings-banner p {
    color: var(--text-light);
    font-size: .95rem;
}

/* ---- Pricing Tabs & Tables ---- */

.pricing-tabs {
    display: flex;
    justify-content: center;
    gap: .5rem;
    margin-bottom: 2rem;
    flex-wrap: wrap;
}

.pricing-tab {
    padding: .65rem 1.35rem;
    border: 1.5px solid var(--border);
    background: #fff;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    font-size: .9rem;
    transition: all .2s;
    color: var(--text-light);
}

.pricing-tab:hover {
    border-color: var(--primary);
    color: var(--primary);
}

.pricing-tab.active {
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
}

.pricing-panel {
    display: none;
}

.pricing-panel.active {
    display: block;
}

.pricing-provider {
    background: #fff;
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 1.25rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, .04);
    border: 1px solid var(--border);
    overflow-x: auto;
}

.pricing-provider-title {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--secondary);
    margin-bottom: .75rem;
    padding-bottom: .5rem;
    border-bottom: 2px solid var(--primary);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.pricing-provider-title .vs-label {
    font-size: .75rem;
    font-weight: 400;
    color: var(--text-light);
    background: var(--bg-light);
    padding: .25rem .75rem;
    border-radius: 12px;
}

.pricing-table {
    width: 100%;
    border-collapse: collapse;
    font-size: .85rem;
    min-width: 500px;
}

.pricing-table th {
    text-align: left;
    padding: .6rem .75rem;
    background: var(--bg-light);
    color: var(--text);
    font-weight: 600;
    border-bottom: 2px solid var(--border);
    white-space: nowrap;
    font-size: .8rem;
}

.pricing-table td {
    padding: .55rem .75rem;
    border-bottom: 1px solid var(--border);
    color: var(--text);
}

.pricing-table tr:hover td {
    background: rgba(37, 99, 235, .03);
}

.pricing-table .price {
    font-weight: 600;
    color: var(--primary);
}

.pricing-table .free {
    color: var(--success);
    font-weight: 600;
}

.pricing-table .vs-openai {
    font-size: .75rem;
    color: var(--success);
    font-weight: 600;
}

.pricing-note {
    text-align: center;
    color: var(--text-light);
    font-size: .82rem;
    margin-top: 1.5rem;
    padding: 1rem;
    background: rgba(37, 99, 235, .04);
    border-radius: 8px;
}

/* ---- Coding Plan Cards ---- */

.coding-plan-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 1.25rem;
}

.coding-plan-card {
    background: #fff;
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, .04);
    border: 1px solid var(--border);
}

.coding-plan-card h4 {
    font-size: 1rem;
    color: var(--secondary);
    margin-bottom: .75rem;
    padding-bottom: .5rem;
    border-bottom: 2px solid var(--primary);
}

.coding-plan-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: .5rem 0;
    border-bottom: 1px solid var(--border);
}

.coding-plan-item:last-child {
    border-bottom: none;
}

.coding-plan-name {
    font-weight: 500;
    color: var(--text);
}

.coding-plan-price {
    font-weight: 700;
    color: var(--primary);
}

.coding-plan-limit {
    font-size: .78rem;
    color: var(--text-light);
}

/* ---- News Article ---- */

.news-article {
    background: #fff;
    border-radius: 16px;
    padding: 3rem;
    box-shadow: 0 4px 20px rgba(0, 0, 0, .04);
    border: 1px solid #bae6fd;
    max-width: 900px;
    margin: 0 auto;
}

.news-article-header {
    margin-bottom: 2rem;
    padding-bottom: 1.5rem;
    border-bottom: 2px solid var(--accent);
}

.news-article-date {
    display: inline-block;
    background: var(--accent);
    color: #fff;
    padding: .3rem 1rem;
    border-radius: 20px;
    font-size: .8rem;
    font-weight: 600;
    margin-bottom: 1rem;
}

.news-article h3 {
    font-size: 1.6rem;
    color: var(--secondary);
    margin-bottom: .5rem;
    line-height: 1.4;
}

.news-article-source {
    color: var(--text-light);
    font-size: .88rem;
}

.news-body p {
    color: var(--text);
    font-size: 1rem;
    line-height: 1.85;
    margin-bottom: 1rem;
}

.news-body .news-highlight {
    background: linear-gradient(135deg, rgba(59, 130, 246, .06), rgba(37, 99, 235, .04));
    border-left: 4px solid var(--primary);
    padding: 1.25rem 1.5rem;
    border-radius: 0 8px 8px 0;
    margin: 1.25rem 0;
}

.news-body .news-highlight p {
    margin-bottom: 0;
    font-style: italic;
}

.news-body .news-quote-block {
    background: var(--bg-light);
    padding: 1.5rem 2rem;
    border-radius: 12px;
    margin: 1.25rem 0;
}

.news-body .news-quote-block p {
    margin-bottom: .5rem;
}

.news-body .news-quote-block .news-quote-author {
    color: var(--text-light);
    font-size: .85rem;
    font-weight: 600;
}

/* ---- Security Cards ---- */

.security-card {
    background: #fff;
    border-radius: 12px;
    padding: 2rem;
    border: 1px solid var(--border);
    transition: all .2s;
}

.security-card:hover {
    border-color: var(--primary);
    box-shadow: 0 4px 12px rgba(37, 99, 235, .06);
}

.security-card h3 {
    color: var(--secondary);
    margin-bottom: .75rem;
    display: flex;
    align-items: center;
    gap: .5rem;
    font-size: 1.05rem;
}

.security-card p {
    color: var(--text-light);
    font-size: .92rem;
    line-height: 1.5;
}

/* ---- Experience Cards ---- */

.experience-card {
    background: rgba(255, 255, 255, .04);
    border: 1px solid rgba(255, 255, 255, .08);
    border-radius: 12px;
    padding: 1.5rem;
    transition: all .25s;
}

.experience-card:hover {
    background: rgba(255, 255, 255, .07);
    border-color: var(--primary);
}

.experience-card .emoji {
    font-size: 1.5rem;
    margin-bottom: .75rem;
}

.experience-card h4 {
    color: #fff;
    font-size: 1.05rem;
    margin-bottom: .5rem;
}

.experience-card p {
    color: rgba(255, 255, 255, .65);
    font-size: .88rem;
    line-height: 1.6;
}

/* ---- Blog Post ---- */

.blog-post {
    max-width: 800px;
    margin: 0 auto;
    background: #fff;
    border-radius: 16px;
    padding: 3rem;
    box-shadow: 0 4px 20px rgba(0, 0, 0, .04);
    border: 1px solid var(--border);
}

.blog-meta {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 2rem;
}

.blog-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-weight: 700;
    font-size: 1.2rem;
    flex-shrink: 0;
}

.blog-author-name {
    font-weight: 600;
    color: var(--text);
}

.blog-date {
    font-size: .85rem;
    color: var(--text-light);
}

.blog-post h3 {
    font-size: 1.6rem;
    color: var(--secondary);
    margin-bottom: 1.25rem;
    line-height: 1.4;
}

.blog-content p {
    color: var(--text);
    font-size: 1rem;
    line-height: 1.8;
    margin-bottom: 1.15rem;
}

.blog-highlight-box {
    background: linear-gradient(135deg, rgba(37, 99, 235, .06), rgba(59, 130, 246, .04));
    border-left: 4px solid var(--primary);
    padding: 1.25rem 1.5rem;
    border-radius: 0 8px 8px 0;
    margin: 1.5rem 0;
}

.blog-highlight-box p {
    margin-bottom: 0 !important;
    font-style: italic;
}

.blog-divider {
    border: none;
    height: 1px;
    background: var(--border);
    margin: 1.5rem 0;
}

.blog-tags {
    display: flex;
    flex-wrap: wrap;
    gap: .4rem;
    margin-top: 1.5rem;
}

.blog-tag {
    background: var(--bg-light);
    color: var(--text-light);
    padding: .3rem .8rem;
    border-radius: 16px;
    font-size: .78rem;
    border: 1px solid var(--border);
}

/* ---- Contact Methods & Form ---- */

.contact-method {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: .9rem 1.25rem;
    background: var(--bg-light);
    border-radius: 10px;
    text-decoration: none;
    color: var(--text);
    transition: all .2s;
}

.contact-method:hover {
    background: var(--primary);
    color: #fff;
    transform: translateX(4px);
}

.contact-method-icon {
    width: 40px;
    height: 40px;
    background: var(--primary);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.contact-method:hover .contact-method-icon {
    background: rgba(255, 255, 255, .15);
}

.contact-method .label {
    font-weight: 600;
    font-size: .9rem;
}

.contact-method .sub {
    font-size: .82rem;
    opacity: .8;
}

.contact-form {
    background: var(--bg-light);
    padding: 2rem;
    border-radius: 16px;
}

.contact-form h3 {
    color: var(--secondary);
    margin-bottom: 1.5rem;
    font-size: 1.3rem;
}

.form-group {
    margin-bottom: 1rem;
}

.form-group label {
    display: block;
    margin-bottom: .4rem;
    color: var(--text);
    font-weight: 500;
    font-size: .88rem;
}

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: .7rem 1rem;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: .9rem;
    transition: border-color .2s;
    font-family: inherit;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, .1);
}

.form-group textarea {
    min-height: 100px;
    resize: vertical;
}

.form-submit {
    width: 100%;
    padding: .9rem;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: .95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all .2s;
}

.form-submit:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(37, 99, 235, .3);
}
