/* ==========================================================================
   InvestPlan SK - Components Styling
   ========================================================================== */

/* Glass / Surface Cards */
.card {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 24px;
    box-shadow: var(--shadow-subtle);
    position: relative;
    transition: var(--transition);
}

.card:hover {
    border-color: rgba(255, 255, 255, 0.14);
}

/* Sidebar / Controls Panel */
.sidebar-panel {
    display: flex;
    flex-direction: column;
    gap: 20px;
    position: sticky;
    top: 24px;
}

.section-header {
    margin-bottom: 20px;
}

.section-title {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 8px;
}

.section-desc {
    font-size: 0.82rem;
    color: var(--text-secondary);
    margin-top: 4px;
}

/* Form Groups */
.form-group {
    margin-bottom: 20px;
}

.form-label-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.form-label {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-primary);
}

.input-with-unit {
    display: flex;
    align-items: center;
    background: var(--bg-surface-elevated);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 4px 10px;
    width: 140px;
    transition: var(--transition);
}

.input-with-unit:focus-within {
    border-color: var(--accent-blue);
    box-shadow: 0 0 0 2px var(--accent-blue-glow);
}

.input-with-unit input {
    background: transparent;
    border: none;
    color: var(--text-primary);
    font-family: var(--font-mono);
    font-size: 0.95rem;
    font-weight: 600;
    width: 100%;
    text-align: right;
    outline: none;
}

.input-with-unit .unit {
    color: var(--text-muted);
    font-size: 0.85rem;
    font-weight: 600;
    margin-left: 6px;
    user-select: none;
}

/* Slider Controls */
.slider-container {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.range-slider {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    height: 6px;
    border-radius: 4px;
    background: var(--bg-surface-elevated);
    outline: none;
    cursor: pointer;
    transition: var(--transition);
}

.range-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--accent-blue);
    border: 2px solid #ffffff;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
    cursor: pointer;
    transition: transform 0.1s ease;
}

.range-slider::-webkit-slider-thumb:hover {
    transform: scale(1.15);
}

.slider-scale {
    display: flex;
    justify-content: space-between;
    font-size: 0.72rem;
    color: var(--text-muted);
    font-family: var(--font-mono);
}

/* Frequency Pills */
.frequency-pill-group {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    background: var(--bg-surface-elevated);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 3px;
    gap: 4px;
    margin-top: 8px;
}

.freq-btn {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    padding: 8px 4px;
    font-size: 0.8rem;
    font-weight: 600;
    border-radius: 6px;
    cursor: pointer;
    transition: var(--transition);
    text-align: center;
}

.freq-btn.active {
    background: var(--accent-blue);
    color: #ffffff;
    box-shadow: 0 2px 8px var(--accent-blue-glow);
}

/* Inflation Toggle Card */
.inflation-toggle-card {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.05) 0%, rgba(16, 185, 129, 0.05) 100%);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 14px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.switch-label-area {
    display: flex;
    flex-direction: column;
}

.switch-title {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--text-primary);
}

.switch-subtitle {
    font-size: 0.75rem;
    color: var(--text-secondary);
}

/* Custom Switch */
.switch-control {
    position: relative;
    display: inline-block;
    width: 48px;
    height: 26px;
    flex-shrink: 0;
}

.switch-control input {
    opacity: 0;
    width: 0;
    height: 0;
}

.switch-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: var(--bg-surface-elevated);
    border: 1px solid var(--border-color);
    transition: .3s;
    border-radius: 34px;
}

.switch-slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background-color: var(--text-secondary);
    transition: .3s;
    border-radius: 50%;
}

input:checked + .switch-slider {
    background-color: var(--accent-emerald);
    border-color: var(--accent-emerald);
}

input:checked + .switch-slider:before {
    transform: translateX(22px);
    background-color: #ffffff;
}

/* Advanced fees accordion */
.advanced-accordion-btn {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 14px;
    background: var(--bg-surface-elevated);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
}

.advanced-accordion-btn:hover {
    color: var(--text-primary);
    border-color: rgba(255, 255, 255, 0.15);
}

.advanced-fees-content {
    display: none;
    flex-direction: column;
    gap: 14px;
    margin-top: 12px;
    padding: 14px;
    background: var(--bg-surface-elevated);
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-color);
}

.advanced-fees-content.open {
    display: flex;
}

.fee-custom-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.8rem;
}

.fee-input-mini {
    width: 70px;
    padding: 4px 6px;
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    color: var(--text-primary);
    font-family: var(--font-mono);
    font-size: 0.8rem;
    text-align: right;
}

/* ==========================================================================
   Content Area / Results & Visuals
   ========================================================================== */

.content-area {
    display: flex;
    flex-direction: column;
    gap: 28px;
}

/* Platform KPI Cards Grid */
.platform-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 16px;
}

.platform-card {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 22px;
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 16px;
    box-shadow: var(--shadow-subtle);
    transition: transform 0.2s ease, border-color 0.2s ease;
}

.platform-card:hover {
    transform: translateY(-2px);
}

.platform-card.highlight-broker {
    border-color: rgba(16, 185, 129, 0.35);
    background: linear-gradient(180deg, rgba(16, 185, 129, 0.04) 0%, var(--bg-surface) 100%);
    box-shadow: 0 4px 20px rgba(16, 185, 129, 0.08);
}

.platform-card.highlight-finax {
    border-color: rgba(59, 130, 246, 0.35);
}

.platform-card.highlight-bank {
    border-color: rgba(239, 68, 68, 0.35);
}

.platform-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 10px;
}

.platform-title-group {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.platform-name {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 8px;
}

.platform-desc {
    font-size: 0.78rem;
    color: var(--text-secondary);
    line-height: 1.35;
}

/* Badges */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 8px;
    border-radius: var(--radius-full);
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.01em;
    white-space: nowrap;
}

.badge-success { background: var(--badge-success-bg); color: var(--badge-success-text); }
.badge-primary { background: var(--badge-primary-bg); color: var(--badge-primary-text); }
.badge-danger  { background: var(--badge-danger-bg);  color: var(--badge-danger-text);  }
.badge-neutral { background: var(--badge-neutral-bg); color: var(--badge-neutral-text); }

/* KPI Numbers */
.kpi-main-balance {
    display: flex;
    flex-direction: column;
    padding: 12px 14px;
    background: var(--bg-surface-elevated);
    border-radius: var(--radius-sm);
}

.kpi-label {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.kpi-value-huge {
    font-family: var(--font-mono);
    font-size: 1.65rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-top: 2px;
}

.kpi-stats-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.kpi-stat-item {
    display: flex;
    flex-direction: column;
}

.kpi-stat-value {
    font-family: var(--font-mono);
    font-size: 0.92rem;
    font-weight: 600;
}

.stat-profit { color: var(--accent-emerald); }
.stat-loss   { color: var(--accent-red); }
.stat-tax    { color: var(--accent-amber); }

/* Loss Callout Banner */
.loss-diff-banner {
    margin-top: auto;
    padding: 8px 10px;
    border-radius: 6px;
    font-size: 0.78rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 6px;
}

.loss-diff-danger {
    background: rgba(239, 68, 68, 0.12);
    color: #f87171;
    border: 1px solid rgba(239, 68, 68, 0.25);
}

.loss-diff-winner {
    background: rgba(16, 185, 129, 0.12);
    color: #34d399;
    border: 1px solid rgba(16, 185, 129, 0.25);
}

/* ==========================================================================
   Charts Section
   ========================================================================== */

.chart-card {
    padding: 24px;
}

.chart-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 12px;
}

.chart-tabs {
    display: flex;
    background: var(--bg-surface-elevated);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 3px;
    gap: 2px;
}

.chart-tab-btn {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    padding: 6px 14px;
    font-size: 0.82rem;
    font-weight: 600;
    border-radius: 6px;
    cursor: pointer;
    transition: var(--transition);
}

.chart-tab-btn.active {
    background: var(--bg-surface);
    color: var(--text-primary);
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.2);
}

.chart-canvas-container {
    position: relative;
    width: 100%;
    height: 380px;
}

/* ==========================================================================
   Milestones Section
   ========================================================================== */

.milestones-card {
    padding: 24px;
}

.milestones-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
    gap: 12px;
    margin-top: 16px;
}

.milestone-item {
    background: var(--bg-surface-elevated);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 12px;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 6px;
    transition: var(--transition);
}

.milestone-item:hover {
    border-color: rgba(255, 255, 255, 0.16);
    transform: translateY(-2px);
}

.milestone-target {
    font-family: var(--font-mono);
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-primary);
}

.milestone-years-list {
    display: flex;
    flex-direction: column;
    gap: 3px;
    width: 100%;
    font-size: 0.72rem;
    margin-top: 4px;
}

.milestone-row {
    display: flex;
    justify-content: space-between;
    width: 100%;
}

.milestone-platform {
    color: var(--text-muted);
}

.milestone-year {
    font-weight: 700;
    font-family: var(--font-mono);
}

/* ==========================================================================
   Yearly Breakdown Table
   ========================================================================== */

.table-card {
    padding: 24px;
}

.table-header-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    flex-wrap: wrap;
    gap: 12px;
}

.table-wrapper {
    overflow-x: auto;
    max-height: 440px;
    overflow-y: auto;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
}

.table-custom {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85rem;
    text-align: right;
    white-space: nowrap;
}

.table-custom th {
    background: var(--bg-surface-elevated);
    color: var(--text-secondary);
    font-weight: 600;
    padding: 12px 16px;
    position: sticky;
    top: 0;
    z-index: 2;
    border-bottom: 1px solid var(--border-color);
}

.table-custom th:first-child,
.table-custom td:first-child {
    text-align: center;
}

.table-custom td {
    padding: 10px 16px;
    border-bottom: 1px solid var(--border-color);
    font-family: var(--font-mono);
    color: var(--text-primary);
}

.table-custom tr:hover td {
    background: var(--bg-surface-hover);
}

/* Slovakia Law Alert Box */
.tax-info-box {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.08) 0%, rgba(16, 185, 129, 0.08) 100%);
    border: 1px solid rgba(59, 130, 246, 0.25);
    border-radius: var(--radius-md);
    padding: 22px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.tax-info-title {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 8px;
}

.tax-info-p {
    font-size: 0.86rem;
    color: var(--text-secondary);
    line-height: 1.6;
}

.tax-info-p strong {
    color: var(--text-primary);
}

/* Footer */
.app-footer {
    margin-top: 48px;
    padding-top: 24px;
    border-top: 1px solid var(--border-color);
    text-align: center;
    font-size: 0.8rem;
    color: var(--text-muted);
}
