/* DSO/DPO/CCC Calculator - Tool Styles */
/* All classes prefixed with dc- to avoid collisions */

/* Calculator Section */
.dc-calculator-section {
    padding: 40px 0 80px;
}

.dc-calculator-section .container {
    max-width: 1200px;
    margin-left: auto;
    margin-right: auto;
}

/* Reveal Animation */
.dc-reveal {
    animation: dcReveal 0.4s ease-out;
}

@keyframes dcReveal {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Card Container */
.dc-card {
    background: var(--bg-card, #fff);
    border: 1px solid var(--border-color, #e2e0dc);
    border-radius: 16px;
    padding: 40px;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.06);
}

.dc-card h2 {
    font-family: 'Bricolage Grotesque', serif;
    font-size: 24px;
    font-weight: 700;
    color: var(--text-primary, #1a1715);
    margin-bottom: 8px;
}

.dc-card h2 + p {
    color: var(--text-secondary, #6b6560);
    margin-bottom: 32px;
    font-size: 15px;
}

/* Section Divider */
.dc-section-divider {
    display: flex;
    align-items: center;
    gap: 16px;
    margin: 32px 0 24px;
}

.dc-section-divider::before,
.dc-section-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--border-color, #e2e0dc);
}

.dc-section-divider span {
    font-family: 'Bricolage Grotesque', serif;
    font-size: 14px;
    font-weight: 600;
    color: var(--primary, #f1643f);
    text-transform: uppercase;
    letter-spacing: 1px;
    white-space: nowrap;
}

/* Form Layout */
.dc-form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
}

.dc-form-grid .dc-form-full {
    grid-column: 1 / -1;
}

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

.dc-form-group label {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary, #1a1715);
}

.dc-form-group label .dc-required {
    color: var(--primary, #f1643f);
}

.dc-form-group label .dc-optional {
    font-weight: 400;
    color: var(--text-secondary, #6b6560);
    font-size: 12px;
}

.dc-form-group select,
.dc-form-group input[type="text"] {
    padding: 10px 14px;
    border: 1px solid var(--border-color, #e2e0dc);
    border-radius: 8px;
    font-size: 14px;
    font-family: 'Hanken Grotesk', sans-serif;
    color: var(--text-primary, #1a1715);
    background: var(--bg-card, #fff);
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    outline: none;
    width: 100%;
    box-sizing: border-box;
}

.dc-form-group select:focus,
.dc-form-group input:focus {
    border-color: var(--primary, #f1643f);
    box-shadow: 0 0 0 3px rgba(241, 100, 63, 0.1);
}

.dc-form-group select {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none' stroke='%236b6560' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m4 6 4 4 4-4'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 36px;
}

/* Currency Input with Rupee Prefix */
.dc-currency-input {
    display: flex;
    align-items: stretch;
}

.dc-currency-prefix {
    display: flex;
    align-items: center;
    padding: 10px 12px;
    background: rgba(0, 0, 0, 0.03);
    border: 1px solid var(--border-color, #e2e0dc);
    border-right: none;
    border-radius: 8px 0 0 8px;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-secondary, #6b6560);
    white-space: nowrap;
}

.dc-currency-input input {
    border-radius: 0 8px 8px 0 !important;
}

.dc-field-hint {
    font-size: 12px;
    color: var(--text-secondary, #6b6560);
    margin-top: 2px;
}

/* Period Selector */
.dc-period-selector {
    display: flex;
    gap: 0;
    border: 1px solid var(--border-color, #e2e0dc);
    border-radius: 8px;
    overflow: hidden;
}

.dc-period-btn {
    flex: 1;
    padding: 10px 16px;
    border: none;
    background: var(--bg-card, #fff);
    font-size: 13px;
    font-weight: 600;
    font-family: 'Hanken Grotesk', sans-serif;
    color: var(--text-secondary, #6b6560);
    cursor: pointer;
    transition: all 0.2s ease;
    border-right: 1px solid var(--border-color, #e2e0dc);
}

.dc-period-btn:last-child {
    border-right: none;
}

.dc-period-btn:hover {
    background: rgba(241, 100, 63, 0.04);
    color: var(--primary, #f1643f);
}

.dc-period-btn.active {
    background: var(--primary, #f1643f);
    color: #fff;
}

/* Buttons */
.dc-btn-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 32px;
    gap: 16px;
}

.dc-btn-primary {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 16px 36px;
    background: var(--primary, #f1643f);
    color: #fff;
    border: none;
    border-radius: 10px;
    font-size: 16px;
    font-weight: 600;
    font-family: 'Hanken Grotesk', sans-serif;
    cursor: pointer;
    transition: all 0.2s ease;
}

.dc-btn-primary:hover {
    background: #d4532f;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(241, 100, 63, 0.3);
}

.dc-btn-primary:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.dc-btn-secondary {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 28px;
    background: transparent;
    color: var(--text-primary, #1a1715);
    border: 1px solid var(--border-color, #e2e0dc);
    border-radius: 8px;
    font-size: 15px;
    font-weight: 600;
    font-family: 'Hanken Grotesk', sans-serif;
    cursor: pointer;
    transition: all 0.2s ease;
}

.dc-btn-secondary:hover {
    border-color: var(--text-secondary, #6b6560);
    background: rgba(0, 0, 0, 0.02);
}

/* ===== RESULTS ===== */

/* Metric Cards */
.dc-metric-cards {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    margin-bottom: 32px;
}

.dc-metric-card {
    text-align: center;
    padding: 24px 16px;
    border-radius: 12px;
    border: 1px solid var(--border-color, #e2e0dc);
    background: var(--bg-card, #fff);
    position: relative;
}

.dc-metric-card .dc-metric-label {
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-secondary, #6b6560);
    margin-bottom: 8px;
}

.dc-metric-card .dc-metric-value {
    font-family: 'Bricolage Grotesque', serif;
    font-size: 36px;
    font-weight: 800;
    line-height: 1;
    margin-bottom: 4px;
    color: var(--text-primary, #1a1715);
}

.dc-metric-card .dc-metric-unit {
    font-size: 13px;
    color: var(--text-secondary, #6b6560);
    margin-bottom: 10px;
}

/* Health Badges */
.dc-health-badge {
    display: inline-block;
    font-size: 11px;
    font-weight: 700;
    padding: 3px 10px;
    border-radius: 20px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.dc-health-badge.good {
    background: rgba(34, 197, 94, 0.1);
    color: #16a34a;
}

.dc-health-badge.moderate {
    background: rgba(245, 158, 11, 0.1);
    color: #d97706;
}

.dc-health-badge.poor {
    background: rgba(239, 68, 68, 0.1);
    color: #dc2626;
}

/* Metric Card Color Borders */
.dc-metric-card.dso {
    border-top: 3px solid #3b82f6;
}

.dc-metric-card.dpo {
    border-top: 3px solid #a855f7;
}

.dc-metric-card.dio {
    border-top: 3px solid #f97316;
}

.dc-metric-card.ccc {
    border-top: 3px solid #16a34a;
}

/* Horizontal Bar Chart */
.dc-chart-section {
    margin-bottom: 32px;
}

.dc-chart-section h3 {
    font-family: 'Bricolage Grotesque', serif;
    font-size: 18px;
    font-weight: 700;
    color: var(--text-primary, #1a1715);
    margin-bottom: 20px;
}

.dc-bar-group {
    margin-bottom: 16px;
}

.dc-bar-label {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary, #1a1715);
    margin-bottom: 6px;
}

.dc-bar-label span:last-child {
    font-family: 'Bricolage Grotesque', serif;
    font-size: 15px;
    font-weight: 700;
}

.dc-bar-track {
    height: 32px;
    border-radius: 8px;
    background: rgba(0, 0, 0, 0.04);
    position: relative;
    overflow: hidden;
}

.dc-bar-fill {
    height: 100%;
    border-radius: 8px;
    transition: width 0.8s ease-out;
    min-width: 2px;
}

.dc-bar-fill.dso {
    background: linear-gradient(90deg, #3b82f6, #60a5fa);
}

.dc-bar-fill.dpo {
    background: linear-gradient(90deg, #a855f7, #c084fc);
}

.dc-bar-fill.dio {
    background: linear-gradient(90deg, #f97316, #fb923c);
}

.dc-bar-fill.ccc-positive {
    background: linear-gradient(90deg, #f59e0b, #fbbf24);
}

.dc-bar-fill.ccc-negative {
    background: linear-gradient(90deg, #22c55e, #4ade80);
}

/* Interpretation Text */
.dc-interpretation {
    padding: 20px 24px;
    border-radius: 12px;
    background: rgba(59, 130, 246, 0.04);
    border: 1px solid rgba(59, 130, 246, 0.12);
    margin-bottom: 32px;
    font-size: 14px;
    color: var(--text-primary, #1a1715);
    line-height: 1.7;
}

.dc-interpretation h3 {
    font-family: 'Bricolage Grotesque', serif;
    font-size: 16px;
    font-weight: 700;
    margin-bottom: 8px;
    color: var(--text-primary, #1a1715);
}

.dc-interpretation p {
    margin: 0 0 8px;
}

.dc-interpretation p:last-child {
    margin-bottom: 0;
}

/* Benchmark Table */
.dc-benchmark-section {
    margin-bottom: 32px;
}

.dc-benchmark-section h3 {
    font-family: 'Bricolage Grotesque', serif;
    font-size: 18px;
    font-weight: 700;
    color: var(--text-primary, #1a1715);
    margin-bottom: 16px;
}

.dc-benchmark-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.dc-benchmark-table thead th {
    text-align: left;
    padding: 10px 16px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-secondary, #6b6560);
    background: rgba(0, 0, 0, 0.02);
    border-bottom: 1px solid var(--border-color, #e2e0dc);
}

.dc-benchmark-table tbody td {
    padding: 12px 16px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.04);
    color: var(--text-primary, #1a1715);
}

.dc-benchmark-table tbody tr:last-child td {
    border-bottom: none;
}

.dc-benchmark-table tbody tr.dc-highlight {
    background: rgba(241, 100, 63, 0.04);
    font-weight: 600;
}

.dc-benchmark-table .dc-range-bar {
    display: inline-block;
    height: 8px;
    border-radius: 4px;
    background: linear-gradient(90deg, #22c55e, #f59e0b, #ef4444);
    min-width: 60px;
    vertical-align: middle;
    margin-right: 8px;
}

/* ===== SEO CONTENT ===== */
.dc-seo-content {
    padding: 80px 0;
    background: rgba(0, 0, 0, 0.02);
}

.dc-seo-content h2 {
    font-family: 'Bricolage Grotesque', serif;
    font-size: 28px;
    font-weight: 700;
    color: var(--text-primary, #1a1715);
    margin-bottom: 12px;
    text-align: center;
}

.dc-seo-content > .container > p {
    text-align: center;
    color: var(--text-secondary, #6b6560);
    max-width: 700px;
    margin: 0 auto 40px;
    line-height: 1.7;
    font-size: 15px;
}

.dc-seo-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 24px;
}

.dc-seo-card {
    padding: 24px;
    border-radius: 12px;
    border: 1px solid var(--border-color, #e2e0dc);
    background: var(--bg-card, #fff);
}

.dc-seo-card h3 {
    font-family: 'Bricolage Grotesque', serif;
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 8px;
    color: var(--text-primary, #1a1715);
}

.dc-seo-card p {
    font-size: 14px;
    color: var(--text-secondary, #6b6560);
    line-height: 1.6;
    margin: 0;
}

/* ===== FAQ SECTION ===== */
.dc-faq-section {
    padding: 80px 0;
}

.dc-faq-section h2 {
    font-family: 'Bricolage Grotesque', serif;
    font-size: 28px;
    font-weight: 700;
    color: var(--text-primary, #1a1715);
    margin-bottom: 32px;
    text-align: center;
}

.dc-faq-list {
    max-width: 800px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.dc-faq-item {
    border: 1px solid var(--border-color, #e2e0dc);
    border-radius: 12px;
    overflow: hidden;
    background: var(--bg-card, #fff);
}

.dc-faq-question {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: 18px 24px;
    border: none;
    background: none;
    font-size: 15px;
    font-weight: 600;
    font-family: 'Hanken Grotesk', sans-serif;
    color: var(--text-primary, #1a1715);
    cursor: pointer;
    text-align: left;
    gap: 16px;
    transition: background 0.2s ease;
}

.dc-faq-question:hover {
    background: rgba(0, 0, 0, 0.02);
}

.dc-faq-question i,
.dc-faq-question svg {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
    color: var(--text-secondary, #6b6560);
    transition: transform 0.2s ease;
}

.dc-faq-item.open .dc-faq-question i,
.dc-faq-item.open .dc-faq-question svg {
    transform: rotate(180deg);
}

.dc-faq-answer {
    display: none;
    padding: 0 24px 18px;
}

.dc-faq-item.open .dc-faq-answer {
    display: block;
}

.dc-faq-answer p {
    font-size: 14px;
    color: var(--text-secondary, #6b6560);
    line-height: 1.7;
    margin: 0;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 809px) {
    .dc-card {
        padding: 24px 20px;
    }

    .dc-form-grid {
        grid-template-columns: 1fr;
    }

    .dc-metric-cards {
        grid-template-columns: repeat(2, 1fr);
    }

    .dc-btn-row {
        flex-direction: column-reverse;
    }

    .dc-btn-primary,
    .dc-btn-secondary {
        width: 100%;
        justify-content: center;
    }

    .dc-seo-grid {
        grid-template-columns: 1fr;
    }

    .dc-benchmark-table {
        font-size: 13px;
    }

    .dc-benchmark-table thead th,
    .dc-benchmark-table tbody td {
        padding: 10px 12px;
    }
}

@media (max-width: 480px) {
    .dc-calculator-section {
        padding: 0 0 48px;
    }

    .dc-card {
        padding: 20px 16px;
        border-radius: 12px;
    }

    .dc-card h2 {
        font-size: 20px;
    }

    .dc-metric-cards {
        grid-template-columns: 1fr 1fr;
        gap: 10px;
    }

    .dc-metric-card {
        padding: 16px 12px;
    }

    .dc-metric-card .dc-metric-value {
        font-size: 28px;
    }

    .dc-period-btn {
        padding: 8px 10px;
        font-size: 12px;
    }

    .dc-seo-content {
        padding: 48px 0;
    }

    .dc-seo-content h2 {
        font-size: 22px;
    }

    .dc-faq-section {
        padding: 48px 0;
    }

    .dc-faq-section h2 {
        font-size: 22px;
    }

    .dc-faq-question {
        padding: 14px 16px;
        font-size: 14px;
    }

    .dc-faq-answer {
        padding: 0 16px 14px;
    }

    .dc-section-divider {
        margin: 24px 0 20px;
    }

    .dc-benchmark-table thead th,
    .dc-benchmark-table tbody td {
        padding: 8px 8px;
        font-size: 12px;
    }
}
