/**
 * LakásŐr - Költségkalkulátor stílusok
 * Kiemelve a koltseg.php-ból
 */

/* Calculator Layout */
.calculator-layout {
    display: grid;
    grid-template-columns: 1fr 400px;
    gap: var(--space-8);
    align-items: start;
}

@media (max-width: 1024px) {
    .calculator-layout {
        grid-template-columns: 1fr;
    }
}

/* Calculator Inputs */
.calculator-inputs {
    display: flex;
    flex-direction: column;
    gap: var(--space-4);
}

/* Calculator Sections */
.calc-section {
    background: var(--color-background);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    transition: box-shadow 0.2s ease;
}

.calc-section:hover {
    box-shadow: var(--shadow-md);
}

.calc-section-highlight {
    border-color: var(--color-primary);
    background: linear-gradient(135deg, var(--color-primary-light) 0%, var(--color-background) 100%);
}

.calc-section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--space-4) var(--space-5);
    cursor: pointer;
    background: var(--color-surface);
    border-bottom: 1px solid var(--color-border);
    transition: background-color 0.2s ease;
}

.calc-section-header:hover {
    background: var(--color-border);
}

.calc-section-title {
    display: flex;
    align-items: center;
    gap: var(--space-3);
}

.calc-section-icon {
    font-size: 1.5rem;
}

.calc-section-title h3 {
    font-size: var(--text-base);
    font-weight: 600;
    color: var(--color-text);
    margin: 0;
}

.calc-section-hint {
    font-size: var(--text-sm);
    color: var(--color-text-secondary);
    margin: 0;
}

.calc-section-toggle {
    font-size: var(--text-sm);
    color: var(--color-text-muted);
    transition: transform 0.2s ease;
    cursor: pointer;
    user-select: none;
}

.calc-section.collapsed .calc-section-toggle {
    transform: rotate(-90deg);
}

/* Ensure header is clickable */
.calc-section-header {
    user-select: none;
}

.calc-section-content {
    padding: var(--space-5);
    display: block;
}

.calc-section.collapsed .calc-section-content {
    display: none;
}

/* Calculator Fields */
.calc-field {
    margin-bottom: var(--space-4);
}

.calc-field:last-child {
    margin-bottom: 0;
}

.calc-field label {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    font-size: var(--text-sm);
    font-weight: 500;
    color: var(--color-text);
    margin-bottom: var(--space-2);
}

.calc-field label input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: var(--color-primary);
}

.field-hint {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 16px;
    height: 16px;
    font-size: 10px;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: 50%;
    color: var(--color-text-muted);
    cursor: help;
}

.input-with-unit {
    display: flex;
    align-items: center;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    overflow: hidden;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.input-with-unit:focus-within {
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px var(--color-primary-light);
}

.input-with-unit input {
    flex: 1;
    padding: var(--space-3) var(--space-4);
    border: none;
    background: transparent;
    font-size: var(--text-base);
    color: var(--color-text);
    outline: none;
    min-width: 0;
}

.input-with-unit input::placeholder {
    color: var(--color-text-muted);
}

.input-with-unit .unit {
    padding: var(--space-3) var(--space-4);
    background: var(--color-border);
    color: var(--color-text-secondary);
    font-size: var(--text-sm);
    font-weight: 500;
    white-space: nowrap;
}

.field-calculated {
    font-size: var(--text-sm);
    color: var(--color-primary);
    font-weight: 500;
    margin-top: var(--space-1);
}

.field-note {
    font-size: var(--text-xs);
    color: var(--color-text-muted);
    margin-top: var(--space-1);
}

.calc-field-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-4);
}

@media (max-width: 640px) {
    .calc-field-grid {
        grid-template-columns: 1fr;
    }
}

/* Period Selector */
.period-selector {
    display: flex;
    gap: var(--space-2);
    margin-bottom: var(--space-3);
    flex-wrap: wrap;
}

.period-btn {
    padding: var(--space-2) var(--space-4);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    background: var(--color-surface);
    color: var(--color-text);
    font-size: var(--text-sm);
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.period-btn:hover {
    border-color: var(--color-primary);
    background: var(--color-primary-light);
}

.period-btn.active {
    background: var(--color-primary);
    border-color: var(--color-primary);
    color: white;
}

.custom-period {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    font-size: var(--text-sm);
    color: var(--color-text-secondary);
}

/* Results Panel */
.calculator-results {
    position: sticky;
    top: calc(var(--header-height, 64px) + var(--space-4));
}

.results-panel {
    background: var(--color-background);
    border: 2px solid var(--color-primary);
    border-radius: var(--radius-xl);
    overflow: hidden;
    box-shadow: var(--shadow-lg);
}

.results-header {
    background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-primary-dark) 100%);
    color: white;
    padding: var(--space-5);
    text-align: center;
}

.results-header h3 {
    font-size: var(--text-xl);
    font-weight: 700;
    margin: 0 0 var(--space-1) 0;
}

.results-header p {
    font-size: var(--text-sm);
    opacity: 0.9;
    margin: 0;
}

/* Result Groups */
.result-group {
    padding: var(--space-4) var(--space-5);
    border-bottom: 1px solid var(--color-border);
}

.result-group-title {
    font-size: var(--text-xs);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--color-text-muted);
    margin: 0 0 var(--space-3) 0;
}

.result-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--space-2) 0;
}

.result-label {
    font-size: var(--text-sm);
    color: var(--color-text-secondary);
}

.result-value {
    font-size: var(--text-sm);
    font-weight: 600;
    color: var(--color-text);
    font-variant-numeric: tabular-nums;
}

.result-row-total {
    margin-top: var(--space-2);
    padding-top: var(--space-3);
    border-top: 1px dashed var(--color-border);
}

.result-row-total .result-label {
    font-weight: 600;
    color: var(--color-text);
}

.result-value-highlight {
    font-size: var(--text-base);
    color: var(--color-primary);
}

/* Result Summary Cards */
.results-panel .result-summary {
    padding: var(--space-4) var(--space-5);
    display: flex;
    flex-direction: column;
    gap: var(--space-3);
}

.summary-card {
    display: flex;
    gap: var(--space-3);
    padding: var(--space-4);
    background: var(--color-surface);
    border-radius: var(--radius-md);
    border: 1px solid var(--color-border);
}

.summary-card-primary {
    background: linear-gradient(135deg, var(--color-primary-light) 0%, var(--color-success-light) 100%);
    border-color: var(--color-primary);
}

.summary-icon {
    font-size: 1.5rem;
}

.summary-content {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.summary-label {
    font-size: var(--text-xs);
    color: var(--color-text-secondary);
    margin-bottom: var(--space-1);
}

.summary-value {
    font-size: var(--text-xl);
    font-weight: 700;
    color: var(--color-text);
    font-variant-numeric: tabular-nums;
}

.summary-card-primary .summary-value {
    color: var(--color-primary-dark);
}

.summary-note {
    font-size: var(--text-xs);
    color: var(--color-text-muted);
    margin-top: var(--space-1);
}

/* Results Actions */
.results-actions {
    padding: var(--space-4) var(--space-5);
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
    border-top: 1px solid var(--color-border);
}

.btn-block {
    width: 100%;
}

/* Results Disclaimer */
.results-disclaimer {
    padding: var(--space-3) var(--space-5) var(--space-4);
}

.results-disclaimer p {
    font-size: var(--text-xs);
    color: var(--color-text-muted);
    text-align: center;
    margin: 0;
    line-height: 1.5;
}

/* Worst Case & Safety Styles */
.result-group-warning {
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.08) 0%, rgba(251, 191, 36, 0.08) 100%);
    border-left: 3px solid var(--color-danger);
}

.result-group-success {
    background: linear-gradient(135deg, rgba(34, 197, 94, 0.08) 0%, rgba(59, 130, 246, 0.08) 100%);
    border-left: 3px solid var(--color-success);
}

.worst-case-info,
.tartalek-info {
    font-size: var(--text-xs);
    color: var(--color-text-muted);
    margin: 0 0 var(--space-2) 0;
    line-height: 1.4;
}

.tartalek-info {
    margin: var(--space-2) 0 0 0;
    padding-top: var(--space-2);
    border-top: 1px dashed var(--color-border);
}

.result-row-warning {
    background: rgba(239, 68, 68, 0.05);
    margin: 0 calc(-1 * var(--space-5));
    padding: var(--space-2) var(--space-5) !important;
}

.result-value-warning {
    color: var(--color-danger) !important;
    font-weight: 700;
}

.result-value-success {
    color: var(--color-success) !important;
    font-weight: 600;
}

/* Warnings Panel */
.warnings-panel {
    padding: 0 var(--space-5) var(--space-4);
}

.warning-item {
    display: flex;
    gap: var(--space-2);
    padding: var(--space-3);
    margin-bottom: var(--space-2);
    background: var(--color-warning-light);
    border-radius: var(--radius-md);
    border-left: 3px solid var(--color-warning);
    font-size: var(--text-xs);
    color: var(--color-text);
    line-height: 1.4;
}

.warning-item:last-child {
    margin-bottom: 0;
}

.warning-item.warning-danger {
    background: rgba(239, 68, 68, 0.1);
    border-left-color: var(--color-danger);
}

.warning-item .warning-icon {
    flex-shrink: 0;
}

.warnings-panel:empty {
    display: none;
}

/* Mobile Results */
@media (max-width: 1024px) {
    .calculator-results {
        position: relative;
        top: 0;
    }
}

/* Print Styles */
@media print {
    .calculator-inputs,
    .results-actions,
    .hero-page,
    .cta-section,
    nav,
    footer {
        display: none !important;
    }
    
    .calculator-layout {
        grid-template-columns: 1fr;
    }
    
    .calculator-results {
        position: relative;
        top: 0;
    }
    
    .results-panel {
        border: 1px solid #000;
        box-shadow: none;
    }
    
    .calc-history-panel,
    .export-dropdown {
        display: none !important;
    }
}

/* ===========================================
   KOLTSEG.PHP SPECIFIKUS UTILITY CLASSES
   =========================================== */

/* Disclaimer section padding */
.section--compact {
    padding-top: var(--space-6);
    padding-bottom: var(--space-6);
}

/* Card warning variant */
.card--disclaimer {
    background: var(--color-warning-light);
    border-color: var(--color-warning);
}

/* Description text in disclaimer */
.card-description--dark {
    color: var(--color-text);
    margin-bottom: 0;
}

/* CTA section background */
.section--surface {
    background: var(--color-surface);
}

/* Period input width */
.period-input--narrow {
    width: 140px;
}

/* ===========================================
   CALCULATION HISTORY PANEL
   =========================================== */

.calc-history-panel {
    margin-top: var(--space-4);
    padding: var(--space-4);
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
}

.calc-history-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--space-3);
}

.calc-history-header h4 {
    margin: 0;
    font-size: var(--text-sm);
    font-weight: 600;
    color: var(--color-text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.calc-history-list {
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
}

.calc-history-item {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    padding: var(--space-2) var(--space-3);
    background: var(--color-background);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.calc-history-item:hover,
.calc-history-item:focus {
    background: var(--color-border);
    outline: none;
}

.calc-history-date {
    font-size: var(--text-xs);
    color: var(--color-text-muted);
    min-width: 100px;
}

.calc-history-value {
    font-size: var(--text-sm);
    font-weight: 600;
    color: var(--color-text);
    flex: 1;
}

.calc-history-period {
    font-size: var(--text-xs);
    color: var(--color-text-secondary);
}

/* ===========================================
   EXPORT DROPDOWN
   =========================================== */

.export-dropdown {
    position: relative;
    display: inline-block;
}

.export-trigger {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
}

.export-trigger .icon-chevron {
    transition: transform 0.2s ease;
}

.export-dropdown.open .export-trigger .icon-chevron {
    transform: rotate(180deg);
}

.export-menu {
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: var(--space-2);
    min-width: 160px;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-8px);
    transition: all 0.2s ease;
    z-index: 100;
}

.export-dropdown.open .export-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.export-menu-item {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    width: 100%;
    padding: var(--space-3) var(--space-4);
    background: none;
    border: none;
    color: var(--color-text);
    font-size: var(--text-sm);
    text-align: left;
    cursor: pointer;
    transition: background-color 0.15s ease;
}

.export-menu-item:first-child {
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}

.export-menu-item:last-child {
    border-radius: 0 0 var(--radius-lg) var(--radius-lg);
}

.export-menu-item:hover {
    background: var(--color-border);
}

.export-menu-item .icon {
    color: var(--color-text-secondary);
}
