/**
 * Kalkulator Imbal Hasil Sewa Properti - Styles
 */

/* CSS Variables */
:root {
    --ryc-primary: #2563eb;
    --ryc-primary-dark: #1d4ed8;
    --ryc-primary-light: #3b82f6;
    --ryc-secondary: #64748b;
    --ryc-success: #10b981;
    --ryc-success-light: #d1fae5;
    --ryc-warning: #f59e0b;
    --ryc-warning-light: #fef3c7;
    --ryc-danger: #ef4444;
    --ryc-danger-light: #fee2e2;
    --ryc-bg: #f8fafc;
    --ryc-card-bg: #ffffff;
    --ryc-text: #1e293b;
    --ryc-text-muted: #64748b;
    --ryc-border: #e2e8f0;
    --ryc-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.1);
    --ryc-shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -4px rgba(0, 0, 0, 0.1);
    --ryc-radius: 12px;
    --ryc-radius-sm: 8px;
}

/* Reset & Base */
.ryc-calculator {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    max-width: 1400px;
    margin: 0 auto;
    padding: 24px;
    background: var(--ryc-bg);
    color: var(--ryc-text);
    line-height: 1.6;
}

.ryc-calculator * {
    box-sizing: border-box;
}

/* Header */
.ryc-header {
    text-align: center;
    margin-bottom: 32px;
    padding: 32px;
    background: linear-gradient(135deg, var(--ryc-primary) 0%, var(--ryc-primary-dark) 100%);
    border-radius: var(--ryc-radius);
    color: white;
}

.ryc-title {
    font-size: 28px;
    font-weight: 700;
    margin: 0 0 12px 0;
}

.ryc-subtitle {
    font-size: 16px;
    opacity: 0.9;
    margin: 0;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

/* Container - Two Column Layout */
.ryc-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
}

@media (max-width: 1024px) {
    .ryc-container {
        grid-template-columns: 1fr;
    }
}

/* Section Headers */
.ryc-section-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 2px solid var(--ryc-border);
}

.ryc-section-icon {
    font-size: 24px;
}

.ryc-section-header h3 {
    font-size: 18px;
    font-weight: 600;
    margin: 0;
    color: var(--ryc-text);
}

/* Cards */
.ryc-card {
    background: var(--ryc-card-bg);
    border-radius: var(--ryc-radius);
    padding: 24px;
    margin-bottom: 16px;
    box-shadow: var(--ryc-shadow);
    border: 1px solid var(--ryc-border);
}

.ryc-card-title {
    font-size: 16px;
    font-weight: 600;
    margin: 0 0 20px 0;
    color: var(--ryc-text);
}

.ryc-card-subtitle {
    font-size: 14px;
    color: var(--ryc-text-muted);
    margin: 4px 0 0 0;
}

/* Form Elements */
.ryc-form-group {
    margin-bottom: 20px;
}

.ryc-form-group:last-child {
    margin-bottom: 0;
}

.ryc-form-row {
    display: flex;
    gap: 16px;
}

.ryc-half {
    flex: 1;
}

.ryc-label {
    display: block;
    font-size: 14px;
    font-weight: 500;
    color: var(--ryc-text-muted);
    margin-bottom: 8px;
}

.ryc-input-wrapper {
    display: flex;
    align-items: center;
    background: var(--ryc-bg);
    border: 1px solid var(--ryc-border);
    border-radius: var(--ryc-radius-sm);
    padding: 0 12px;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.ryc-input-wrapper:focus-within {
    border-color: var(--ryc-primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.ryc-currency {
    font-size: 14px;
    font-weight: 500;
    color: var(--ryc-text-muted);
    margin-right: 8px;
}

.ryc-suffix {
    font-size: 14px;
    font-weight: 500;
    color: var(--ryc-text-muted);
    margin-left: 8px;
}

.ryc-input {
    flex: 1;
    border: none;
    background: transparent;
    padding: 12px 0;
    font-size: 16px;
    font-weight: 600;
    color: var(--ryc-text);
    outline: none;
    width: 100%;
}

.ryc-input-small {
    max-width: 80px;
    text-align: center;
}

/* Slider */
.ryc-slider {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    height: 8px;
    background: linear-gradient(to right, var(--ryc-primary) 0%, var(--ryc-primary) 50%, var(--ryc-border) 50%, var(--ryc-border) 100%);
    border-radius: 4px;
    margin: 12px 0 8px 0;
    cursor: pointer;
}

.ryc-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 24px;
    height: 24px;
    background: var(--ryc-card-bg);
    border: 3px solid var(--ryc-primary);
    border-radius: 50%;
    cursor: pointer;
    box-shadow: var(--ryc-shadow);
    transition: transform 0.2s;
}

.ryc-slider::-webkit-slider-thumb:hover {
    transform: scale(1.1);
}

.ryc-slider::-moz-range-thumb {
    width: 24px;
    height: 24px;
    background: var(--ryc-card-bg);
    border: 3px solid var(--ryc-primary);
    border-radius: 50%;
    cursor: pointer;
    box-shadow: var(--ryc-shadow);
}

.ryc-slider-labels {
    display: flex;
    justify-content: space-between;
    font-size: 12px;
    color: var(--ryc-text-muted);
}

/* Toggle Buttons */
.ryc-toggle-wrapper {
    display: flex;
    background: var(--ryc-bg);
    border-radius: var(--ryc-radius-sm);
    padding: 4px;
    border: 1px solid var(--ryc-border);
}

.ryc-toggle-btn {
    flex: 1;
    padding: 12px 24px;
    border: none;
    background: transparent;
    font-size: 14px;
    font-weight: 600;
    color: var(--ryc-text-muted);
    cursor: pointer;
    border-radius: 6px;
    transition: all 0.2s;
}

.ryc-toggle-btn.active {
    background: var(--ryc-primary);
    color: white;
    box-shadow: var(--ryc-shadow);
}

.ryc-toggle-btn:hover:not(.active) {
    background: var(--ryc-border);
}

/* KPR Section */
.ryc-kpr-section {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px dashed var(--ryc-border);
}

.ryc-kpr-section.hidden {
    display: none;
}

/* Collapsible */
.ryc-collapsible .ryc-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    margin: -24px;
    padding: 24px;
    border-radius: var(--ryc-radius);
    transition: background 0.2s;
}

.ryc-collapsible .ryc-card-header:hover {
    background: var(--ryc-bg);
}

.ryc-collapsible .ryc-card-title {
    margin: 0;
}

.ryc-collapse-btn {
    padding: 8px 16px;
    background: var(--ryc-primary);
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s;
}

.ryc-collapse-btn:hover {
    background: var(--ryc-primary-dark);
}

.ryc-collapse-content {
    display: none;
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px solid var(--ryc-border);
}

.ryc-collapse-content.show {
    display: block;
}

/* Results Section */
.ryc-result-section {
    background: var(--ryc-card-bg);
    border-radius: var(--ryc-radius);
    padding: 24px;
    box-shadow: var(--ryc-shadow-lg);
    border: 1px solid var(--ryc-border);
}

.ryc-result-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 2px solid var(--ryc-border);
}

.ryc-result-header h3 {
    font-size: 20px;
    font-weight: 700;
    margin: 0;
    color: var(--ryc-text);
}

.ryc-share-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 10px 16px;
    background: var(--ryc-bg);
    border: 1px solid var(--ryc-border);
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    color: var(--ryc-text);
    cursor: pointer;
    transition: all 0.2s;
}

.ryc-share-btn:hover {
    background: var(--ryc-primary);
    color: white;
    border-color: var(--ryc-primary);
}

/* Summary */
.ryc-result-summary {
    background: var(--ryc-bg);
    border-radius: var(--ryc-radius-sm);
    padding: 16px;
    margin-bottom: 24px;
}

.ryc-summary-title {
    font-size: 13px;
    color: var(--ryc-text-muted);
    margin: 0 0 8px 0;
}

.ryc-summary-list {
    list-style: none;
    padding: 0;
    margin: 0;
    font-size: 13px;
    color: var(--ryc-text-muted);
}

.ryc-summary-list li {
    padding: 4px 0;
}

.ryc-summary-list strong {
    color: var(--ryc-text);
}

/* Metrics Grid */
.ryc-metrics-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    margin-bottom: 24px;
}

@media (max-width: 600px) {
    .ryc-metrics-grid {
        grid-template-columns: 1fr;
    }
}

.ryc-metric-card {
    background: var(--ryc-bg);
    border-radius: var(--ryc-radius-sm);
    padding: 16px;
    text-align: center;
    border: 1px solid var(--ryc-border);
}

.ryc-metric-label {
    font-size: 12px;
    color: var(--ryc-text-muted);
    margin: 0 0 8px 0;
    line-height: 1.4;
}

.ryc-metric-value {
    font-size: 20px;
    font-weight: 700;
    margin: 0;
    color: var(--ryc-text);
}

.ryc-metric-value.negative {
    color: var(--ryc-danger);
}

.ryc-metric-value.positive {
    color: var(--ryc-success);
}

.ryc-metric-value.highlight {
    color: var(--ryc-primary);
}

/* Details Section */
.ryc-details-toggle {
    margin-bottom: 16px;
}

.ryc-details-btn {
    width: 100%;
    padding: 12px;
    background: var(--ryc-bg);
    border: 1px solid var(--ryc-border);
    border-radius: var(--ryc-radius-sm);
    font-size: 14px;
    font-weight: 500;
    color: var(--ryc-text);
    cursor: pointer;
    transition: all 0.2s;
}

.ryc-details-btn:hover {
    background: var(--ryc-border);
}

.ryc-details-content {
    display: none;
}

.ryc-details-content.show {
    display: block;
}

/* Detail Tables */
.ryc-detail-table {
    margin-bottom: 20px;
}

.ryc-detail-table h4 {
    font-size: 14px;
    font-weight: 600;
    margin: 0 0 12px 0;
    color: var(--ryc-text);
}

.ryc-detail-table table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.ryc-detail-table th,
.ryc-detail-table td {
    padding: 10px 12px;
    text-align: left;
    border-bottom: 1px solid var(--ryc-border);
}

.ryc-detail-table th {
    background: var(--ryc-bg);
    font-weight: 600;
    color: var(--ryc-text-muted);
}

.ryc-detail-table td:not(:first-child) {
    text-align: right;
    font-weight: 500;
}

.ryc-highlight-row td {
    background: var(--ryc-bg);
    font-weight: 600 !important;
}

/* Health Section */
.ryc-health-section {
    margin-top: 24px;
    padding-top: 24px;
    border-top: 1px solid var(--ryc-border);
}

.ryc-consult-btn {
    width: 100%;
    padding: 14px 24px;
    background: linear-gradient(135deg, var(--ryc-primary) 0%, var(--ryc-primary-dark) 100%);
    color: white;
    border: none;
    border-radius: var(--ryc-radius-sm);
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    margin-bottom: 24px;
    transition: transform 0.2s, box-shadow 0.2s;
}

.ryc-consult-btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--ryc-shadow-lg);
}

.ryc-analysis-title {
    font-size: 16px;
    font-weight: 600;
    margin: 0 0 16px 0;
    color: var(--ryc-text);
}

.ryc-health-indicators {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.ryc-health-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 12px;
    border-radius: var(--ryc-radius-sm);
    border: 1px solid var(--ryc-border);
    background: var(--ryc-bg);
    opacity: 0.5;
    transition: all 0.3s;
}

.ryc-health-item.active {
    opacity: 1;
    border-width: 2px;
}

.ryc-health-item.healthy {
    border-color: var(--ryc-success);
}

.ryc-health-item.healthy.active {
    background: var(--ryc-success-light);
}

.ryc-health-item.warning {
    border-color: var(--ryc-warning);
}

.ryc-health-item.warning.active {
    background: var(--ryc-warning-light);
}

.ryc-health-item.danger {
    border-color: var(--ryc-danger);
}

.ryc-health-item.danger.active {
    background: var(--ryc-danger-light);
}

.ryc-health-badge {
    flex-shrink: 0;
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
}

.ryc-health-item.healthy .ryc-health-badge {
    background: var(--ryc-success);
    color: white;
}

.ryc-health-item.warning .ryc-health-badge {
    background: var(--ryc-warning);
    color: white;
}

.ryc-health-item.danger .ryc-health-badge {
    background: var(--ryc-danger);
    color: white;
}

.ryc-health-item p {
    margin: 0;
    font-size: 13px;
    color: var(--ryc-text-muted);
    line-height: 1.5;
}

.ryc-health-item.active p {
    color: var(--ryc-text);
}

/* Responsive */
@media (max-width: 768px) {
    .ryc-calculator {
        padding: 16px;
    }

    .ryc-header {
        padding: 24px 16px;
    }

    .ryc-title {
        font-size: 22px;
    }

    .ryc-subtitle {
        font-size: 14px;
    }

    .ryc-card {
        padding: 16px;
    }

    .ryc-form-row {
        flex-direction: column;
        gap: 12px;
    }

    .ryc-metrics-grid {
        gap: 8px;
    }

    .ryc-metric-value {
        font-size: 18px;
    }
}
