:root {
    --bg-color: #0d1117;
    --panel-bg: rgba(22, 27, 34, 0.7);
    --panel-border: rgba(255, 255, 255, 0.1);
    --text-primary: #f0f6fc;
    --text-secondary: #8b949e;
    --accent: #58a6ff;
    --accent-glow: rgba(88, 166, 255, 0.5);
    --success: #2ea043;
    --success-glow: rgba(46, 160, 67, 0.3);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: 'Inter', sans-serif;
}

body {
    background: var(--bg-color);
    background-image:
        radial-gradient(circle at 15% 50%, rgba(88, 166, 255, 0.1), transparent 25%),
        radial-gradient(circle at 85% 30%, rgba(163, 113, 247, 0.1), transparent 25%);
    background-attachment: fixed;
    color: var(--text-primary);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 2rem;
}

.app-container {
    max-width: 1200px;
    width: 100%;
}

.app-header {
    text-align: center;
    margin-bottom: 3rem;
    animation: fadeInDown 0.8s ease-out;
}

.app-header h1 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.highlight {
    background: -webkit-linear-gradient(0deg, #58a6ff, #a371f7);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.app-header p {
    color: var(--text-secondary);
    font-size: 1.1rem;
}

.dashboard {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    animation: fadeInUp 0.8s ease-out 0.2s both;
}

.panel {
    background: var(--panel-bg);
    border: 1px solid var(--panel-border);
    border-radius: 16px;
    padding: 2rem;
    backdrop-filter: blur(10px);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

.panel h2 {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 1.5rem;
    color: var(--text-primary);
    border-bottom: 1px solid var(--panel-border);
    padding-bottom: 0.75rem;
}

.input-group {
    margin-bottom: 1.25rem;
}

.input-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

label {
    display: block;
    margin-bottom: 0.5rem;
    color: var(--text-secondary);
    font-size: 0.9rem;
    font-weight: 500;
}

input {
    width: 100%;
    padding: 0.75rem 1rem;
    background: rgba(13, 17, 23, 0.8);
    border: 1px solid var(--panel-border);
    border-radius: 8px;
    color: var(--text-primary);
    font-size: 1rem;
    transition: all 0.3s ease;
}

input:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-glow);
}

.divider {
    text-align: center;
    margin: 2rem 0 1rem;
    color: var(--text-secondary);
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    position: relative;
    font-weight: 600;
}

.divider::before,
.divider::after {
    content: '';
    position: absolute;
    top: 50%;
    width: 25%;
    height: 1px;
    background: var(--panel-border);
}

.divider::before {
    left: 0;
}

.divider::after {
    right: 0;
}

.metric-card {
    background: rgba(13, 17, 23, 0.5);
    border: 1px solid var(--panel-border);
    border-radius: 12px;
    padding: 1.5rem;
    text-align: center;
    margin-bottom: 1.5rem;
    transition: transform 0.3s ease, border-color 0.3s ease;
}

.metric-card:hover {
    transform: translateY(-2px);
    border-color: rgba(255, 255, 255, 0.2);
}

.metric-card.primary {
    background: linear-gradient(135deg, rgba(88, 166, 255, 0.1) 0%, rgba(13, 17, 23, 0.5) 100%);
    border-color: rgba(88, 166, 255, 0.3);
}

.metric-card.highlight-card {
    background: linear-gradient(135deg, rgba(46, 160, 67, 0.1) 0%, rgba(13, 17, 23, 0.5) 100%);
    border-color: rgba(46, 160, 67, 0.3);
}

.metric-card h3 {
    font-size: 0.9rem;
    color: var(--text-secondary);
    font-weight: 500;
    margin-bottom: 0.5rem;
}

.metric-value {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--accent);
}

.metric-card.highlight-card .metric-value {
    color: var(--success);
}

.metric-value.small {
    font-size: 1.5rem;
}

.results-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.roi-banner {
    margin-top: 1.5rem;
    background: linear-gradient(90deg, #58a6ff, #a371f7);
    border-radius: 12px;
    padding: 1.5rem;
    text-align: center;
    color: #fff;
    box-shadow: 0 8px 24px rgba(163, 113, 247, 0.25);
    transition: transform 0.3s ease;
}

.roi-banner:hover {
    transform: scale(1.02);
}

.roi-banner h3 {
    font-size: 1rem;
    font-weight: 600;
    opacity: 0.9;
    margin-bottom: 0.25rem;
}

.roi-value {
    font-size: 3rem;
    font-weight: 700;
    line-height: 1;
}

@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@media (max-width: 768px) {
    .dashboard {
        grid-template-columns: 1fr;
    }

    body {
        padding: 1rem;
    }

    .app-header h1 {
        font-size: 2rem;
    }
}

/* --- New Button & Modal Styles --- */

.action-row {
    margin-top: 1.5rem;
    text-align: center;
}

.btn-info {
    background: rgba(88, 166, 255, 0.1);
    border: 1px solid var(--accent);
    color: var(--accent);
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.3s ease;
}

.btn-info:hover {
    background: rgba(88, 166, 255, 0.2);
    box-shadow: 0 0 15px rgba(88, 166, 255, 0.3);
    transform: translateY(-2px);
}

.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(5px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.modal-content {
    background: var(--bg-color);
    border: 1px solid var(--panel-border);
    border-radius: 16px;
    width: 90%;
    max-width: 600px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.5);
    transform: translateY(20px);
    transition: all 0.3s ease;
}

.modal-overlay.active .modal-content {
    transform: translateY(0);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem;
    border-bottom: 1px solid var(--panel-border);
    background: rgba(22, 27, 34, 0.8);
    position: sticky;
    top: 0;
    z-index: 10;
}

.modal-header h2 {
    font-size: 1.25rem;
    margin: 0;
    color: var(--text-primary);
}

.btn-close {
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 1.5rem;
    cursor: pointer;
    transition: color 0.3s ease;
}

.btn-close:hover {
    color: var(--accent);
}

.modal-body {
    padding: 1.5rem;
}

.summary-section,
.formula-section {
    margin-bottom: 2rem;
}

.summary-section h3,
.formula-section h3 {
    color: var(--accent);
    font-size: 1.1rem;
    margin-bottom: 1rem;
    border-bottom: 1px solid rgba(88, 166, 255, 0.2);
    padding-bottom: 0.5rem;
}

.summary-section ul {
    list-style: none;
    padding: 0;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
}

.summary-section li {
    background: rgba(255, 255, 255, 0.05);
    padding: 0.75rem;
    border-radius: 8px;
    font-size: 0.9rem;
    color: var(--text-secondary);
    display: flex;
    flex-direction: column;
}

.summary-section li strong {
    color: var(--text-primary);
    font-size: 1.1rem;
    margin-top: 0.25rem;
}

.formula-item {
    margin-bottom: 1.5rem;
    background: rgba(255, 255, 255, 0.02);
    padding: 1rem;
    border-radius: 8px;
    border-left: 3px solid var(--accent);
}

.formula-item h4 {
    color: var(--text-primary);
    margin-bottom: 0.5rem;
    font-size: 0.95rem;
}

.formula-item code {
    display: block;
    background: rgba(0, 0, 0, 0.3);
    padding: 0.5rem;
    border-radius: 4px;
    color: #a371f7;
    margin-bottom: 0.5rem;
    font-family: monospace;
    font-size: 0.85rem;
}

.formula-item .desc {
    color: var(--text-secondary);
    font-size: 0.85rem;
    line-height: 1.4;
}

/* --- Report Panel Styles --- */
.report-panel {
    margin-top: 2rem;
    animation: fadeInUp 0.8s ease-out 0.4s both;
}

.report-step {
    background: rgba(13, 17, 23, 0.5);
    border-left: 4px solid var(--accent);
    padding: 1.25rem 1.5rem;
    margin-bottom: 1rem;
    border-radius: 0 8px 8px 0;
    transition: transform 0.3s ease;
}

.report-step:hover {
    transform: translateX(5px);
    background: rgba(13, 17, 23, 0.8);
}

.report-step.success {
    border-left-color: var(--success);
}

.report-step h3 {
    color: var(--text-primary);
    font-size: 1.1rem;
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.report-step p {
    color: var(--text-secondary);
    line-height: 1.5;
    font-size: 0.95rem;
}

.report-step strong {
    color: var(--text-primary);
    font-weight: 600;
}