/**
 * Thermo Calculator - CSS Styles
 * Калькулятор утепления и обогрева емкостей
 */

:root {
    --thermo-primary: #e65100;
    --thermo-primary-dark: #bf360c;
    --thermo-secondary: #ff9800;
    --thermo-accent: #ffcc02;
    --thermo-bg: linear-gradient(135deg, #fff3e0 0%, #ffe0b2 100%);
    --thermo-card-bg: rgba(255, 255, 255, 0.95);
    --thermo-text: #263238;
    --thermo-text-muted: #546e7a;
    --thermo-success: #43a047;
    --thermo-warning: #ffc107;
    --thermo-error: #e53935;
    --thermo-shadow: 0 8px 32px rgba(230, 81, 0, 0.15);
    --thermo-radius: 16px;
}

/* Page Layout */
.thermo-calc-page {
    max-width: 1200px;
    margin: 0 auto;
    padding: 40px 20px 60px;
}

/* Hero Section */
.thermo-calc-hero {
    text-align: center;
    padding: 40px 20px;
    background: var(--thermo-bg);
    border-radius: var(--thermo-radius);
    margin-bottom: 30px;
}

.thermo-calc-hero .hero-icon {
    font-size: 64px;
    margin-bottom: 16px;
    animation: heatPulse 2s ease-in-out infinite;
}

@keyframes heatPulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

.thermo-calc-hero h1 {
    font-size: 32px;
    font-weight: 700;
    color: var(--thermo-text);
    margin: 0 0 12px;
}

.thermo-calc-hero .hero-subtitle {
    font-size: 18px;
    color: var(--thermo-text-muted);
    margin: 0;
}

/* Calculator Container */
.thermo-calc-container {
    background: var(--thermo-card-bg);
    border-radius: var(--thermo-radius);
    box-shadow: var(--thermo-shadow);
    padding: 32px;
    margin-bottom: 40px;
}

/* Wizard Progress */
.wizard-progress {
    display: flex;
    justify-content: center;
    gap: 40px;
    padding: 20px 0 30px;
    border-bottom: 1px solid #e0e0e0;
    margin-bottom: 30px;
}

.wizard-step {
    display: flex;
    align-items: center;
    gap: 10px;
    opacity: 0.4;
    transition: all 0.3s ease;
}

.wizard-step.active { opacity: 1; }
.wizard-step.completed { opacity: 0.8; }

.wizard-step .step-num {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: #e0e0e0;
    color: #757575;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    transition: all 0.3s ease;
}

.wizard-step.active .step-num {
    background: var(--thermo-primary);
    color: white;
    box-shadow: 0 4px 12px rgba(230, 81, 0, 0.4);
}

.wizard-step.completed .step-num {
    background: var(--thermo-success);
    color: white;
}

.wizard-step .step-label {
    font-weight: 500;
    color: var(--thermo-text-muted);
}

.wizard-step.active .step-label {
    color: var(--thermo-text);
}

/* Wizard Panels */
.wizard-panel {
    display: none;
}

.wizard-panel.active {
    display: block;
    animation: fadeIn 0.4s ease;
}

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

.wizard-panel h2 {
    font-size: 24px;
    color: var(--thermo-text);
    margin: 0 0 8px;
}

.wizard-panel .step-hint {
    color: var(--thermo-text-muted);
    margin: 0 0 24px;
}

/* Region Selector */
.region-selector {
    margin-bottom: 24px;
}

.search-box {
    position: relative;
    margin-bottom: 20px;
}

.search-box input {
    width: 100%;
    padding: 16px 50px 16px 20px;
    border: 2px solid #e0e0e0;
    border-radius: 12px;
    font-size: 16px;
    transition: all 0.3s ease;
    box-sizing: border-box;
}

.search-box input:focus {
    outline: none;
    border-color: var(--thermo-primary);
    box-shadow: 0 0 0 4px rgba(230, 81, 0, 0.1);
}

.search-box .search-icon {
    position: absolute;
    right: 16px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 20px;
}

/* Region Grid */
.region-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 12px;
    max-height: 350px;
    overflow-y: auto;
    padding: 4px;
}

.region-card {
    padding: 16px;
    background: #f5f5f5;
    border: 2px solid transparent;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.region-card:hover {
    background: #fff3e0;
    border-color: var(--thermo-secondary);
    transform: translateY(-2px);
}

.region-card.selected {
    background: var(--thermo-primary);
    color: white;
    border-color: var(--thermo-primary-dark);
}

.region-card .region-name {
    font-weight: 600;
    margin-bottom: 4px;
}

.region-card .region-temp {
    font-size: 13px;
    opacity: 0.8;
}

.region-card.selected .region-temp {
    color: rgba(255, 255, 255, 0.9);
}

/* Manual Temperature */
.manual-temp-toggle {
    margin: 20px 0;
    padding: 12px 16px;
    background: #fafafa;
    border-radius: 8px;
}

.toggle-label {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    font-weight: 500;
}

.manual-temp-input {
    margin-top: 16px;
    padding: 20px;
    background: #fff8e1;
    border-radius: 12px;
    border: 1px solid #ffecb3;
}

/* Selected Region Info */
.selected-region-info {
    margin-top: 20px;
    padding: 16px;
    background: linear-gradient(135deg, #fff3e0, #ffe0b2);
    border-radius: 12px;
}

.info-badge {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.region-label { color: var(--thermo-text-muted); }

.region-value {
    font-weight: 600;
    font-size: 18px;
    color: var(--thermo-text);
}

.temp-badge {
    background: var(--thermo-primary);
    color: white;
    padding: 6px 14px;
    border-radius: 20px;
    font-weight: 500;
    font-size: 14px;
}

/* Tank Parameters Section */
.params-section {
    background: #f8f9fa;
    border-radius: 12px;
    padding: 24px;
    margin-bottom: 24px;
}

.params-section h3 {
    font-size: 18px;
    color: var(--thermo-text);
    margin: 0 0 16px;
    display: flex;
    align-items: center;
    gap: 10px;
}

/* Shape Selector */
.shape-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.shape-card {
    padding: 20px;
    background: white;
    border: 2px solid #e0e0e0;
    border-radius: 12px;
    cursor: pointer;
    text-align: center;
    transition: all 0.2s ease;
}

.shape-card:hover {
    border-color: var(--thermo-secondary);
    background: #fff8e1;
}

.shape-card.selected {
    border-color: var(--thermo-primary);
    background: linear-gradient(135deg, #fff3e0, #ffe0b2);
}

.shape-icon { font-size: 48px; margin-bottom: 12px; }
.shape-name { font-weight: 600; color: var(--thermo-text); }

/* Dimension Inputs */
.dimension-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
}

.dimension-field {
    display: flex;
    flex-direction: column;
}

.dimension-field label {
    font-weight: 500;
    margin-bottom: 8px;
    color: var(--thermo-text);
}

.dimension-input {
    display: flex;
    align-items: center;
    gap: 8px;
}

.dimension-input input {
    flex: 1;
    padding: 12px 16px;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    font-size: 16px;
    text-align: right;
}

.dimension-input input:focus {
    outline: none;
    border-color: var(--thermo-primary);
}

.input-unit {
    color: var(--thermo-text-muted);
    font-weight: 500;
    min-width: 40px;
}

/* Calculated Volume */
.volume-display {
    background: linear-gradient(135deg, #e8f5e9, #c8e6c9);
    padding: 16px 20px;
    border-radius: 12px;
    margin-top: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.volume-label {
    font-weight: 500;
    color: var(--thermo-text-muted);
}

.volume-value {
    font-size: 24px;
    font-weight: 700;
    color: #2e7d32;
}

.volume-unit {
    font-weight: 500;
    color: #2e7d32;
}

/* Material/Cable Selector */
.material-grid, .cable-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 16px;
}

.insulation-card, .cable-card {
    padding: 20px;
    background: white;
    border: 2px solid #e0e0e0;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.insulation-card:hover, .cable-card:hover {
    border-color: var(--thermo-secondary);
    transform: translateY(-2px);
}

.insulation-card.selected, .cable-card.selected {
    border-color: var(--thermo-primary);
    background: linear-gradient(135deg, #fff3e0, #ffe0b2);
}

.material-header, .cable-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 10px;
}

.material-icon, .cable-icon { font-size: 28px; }

.material-name, .cable-name {
    font-weight: 600;
    color: var(--thermo-text);
}

.material-spec, .cable-spec {
    font-size: 14px;
    color: var(--thermo-text-muted);
}

.material-desc, .cable-desc {
    font-size: 13px;
    color: var(--thermo-text-muted);
    margin-top: 8px;
}

/* Thickness/Options Row */
.options-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.option-field label {
    display: block;
    font-weight: 500;
    margin-bottom: 8px;
    color: var(--thermo-text);
}

.option-field select, .option-field input {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    font-size: 16px;
    box-sizing: border-box;
}

.option-field select:focus, .option-field input:focus {
    outline: none;
    border-color: var(--thermo-primary);
}

.checkbox-field {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    background: #fff8e1;
    border-radius: 10px;
    cursor: pointer;
}

.checkbox-field input {
    width: 20px;
    height: 20px;
}

/* Wizard Nav */
.wizard-nav {
    display: flex;
    justify-content: space-between;
    padding-top: 24px;
    border-top: 1px solid #e0e0e0;
}

.btn-wizard {
    padding: 14px 28px;
    border: none;
    border-radius: 10px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-wizard.btn-back {
    background: #f5f5f5;
    color: var(--thermo-text);
}

.btn-wizard.btn-back:hover { background: #e0e0e0; }

.btn-wizard.btn-next {
    background: var(--thermo-primary);
    color: white;
}

.btn-wizard.btn-next:hover:not(:disabled) {
    background: var(--thermo-primary-dark);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(230, 81, 0, 0.4);
}

.btn-wizard:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn-wizard.btn-calculate {
    background: linear-gradient(135deg, #e65100, #ff9800);
    color: white;
    padding: 16px 32px;
}

.btn-wizard.btn-calculate:hover:not(:disabled) {
    box-shadow: 0 4px 16px rgba(230, 81, 0, 0.4);
}

/* Result Card */
.result-card {
    animation: slideUp 0.5s ease;
}

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

.result-header {
    display: flex;
    align-items: center;
    gap: 16px;
    padding-bottom: 20px;
    border-bottom: 2px solid #ffe0b2;
    margin-bottom: 24px;
}

.result-header .result-icon { font-size: 48px; }

.result-header h2 {
    margin: 0;
    color: var(--thermo-text);
}

/* Result Sections */
.result-section {
    margin-bottom: 28px;
    padding: 24px;
    background: #fafafa;
    border-radius: 12px;
}

.result-section h3 {
    margin: 0 0 16px;
    font-size: 18px;
    color: var(--thermo-text);
}

/* Result Metrics */
.result-metrics {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 16px;
}

.metric-card {
    text-align: center;
    padding: 20px;
    border-radius: 12px;
    background: white;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
}

.metric-card.primary {
    background: linear-gradient(135deg, var(--thermo-primary), var(--thermo-primary-dark));
    color: white;
}

.metric-card.primary .metric-label { color: rgba(255, 255, 255, 0.85); }

.metric-label {
    font-size: 13px;
    color: var(--thermo-text-muted);
    margin-bottom: 8px;
}

.metric-value {
    font-size: 32px;
    font-weight: 700;
    line-height: 1.1;
}

.metric-unit {
    font-size: 14px;
    opacity: 0.8;
}

/* Summary Table */
.summary-table {
    width: 100%;
    border-collapse: collapse;
}

.summary-table tr { border-bottom: 1px solid #e0e0e0; }
.summary-table tr:last-child { border-bottom: none; }

.summary-table td {
    padding: 10px 0;
}

.summary-table td:first-child {
    color: var(--thermo-text-muted);
    width: 50%;
}

.summary-table td:last-child {
    font-weight: 600;
    text-align: right;
}

/* Equipment Grid */
.equipment-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
}

.equipment-card {
    padding: 20px;
    background: white;
    border-radius: 12px;
    border: 2px solid #e0e0e0;
    text-align: center;
    transition: all 0.2s ease;
}

.equipment-card:hover {
    border-color: var(--thermo-primary);
    transform: translateY(-3px);
    box-shadow: 0 8px 24px rgba(230, 81, 0, 0.15);
}

.equipment-icon { font-size: 40px; margin-bottom: 12px; }

.equipment-name {
    font-weight: 600;
    color: var(--thermo-text);
    margin-bottom: 8px;
}

.equipment-spec {
    font-size: 14px;
    color: var(--thermo-primary);
    font-weight: 500;
}

.equipment-detail {
    font-size: 13px;
    color: var(--thermo-text-muted);
    margin-top: 4px;
}

/* Warnings Block */
.warnings-block {
    background: #fff3e0;
    border: 1px solid #ffcc80;
    border-radius: 12px;
    padding: 16px 20px;
}

.warnings-block h4 {
    margin: 0 0 10px;
    color: var(--thermo-primary-dark);
    font-size: 16px;
}

.warnings-block ul {
    margin: 0;
    padding-left: 20px;
    color: #bf360c;
}

.warnings-block li { margin-bottom: 6px; }

/* Legal Block */
.legal-block {
    background: #e8f5e9;
    border: 1px solid #a5d6a7;
}

.legal-badge {
    display: flex;
    align-items: center;
    gap: 12px;
    color: #2e7d32;
    font-weight: 500;
}

.legal-icon { font-size: 24px; }

/* Result Actions */
.result-actions {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
    padding-top: 20px;
    border-top: 1px solid #e0e0e0;
}

.btn-action {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 24px;
    border: none;
    border-radius: 10px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-action.btn-pdf {
    background: #ff7043;
    color: white;
}

.btn-action.btn-pdf:hover {
    background: #f4511e;
    transform: translateY(-2px);
}

.btn-action.btn-consult {
    background: var(--thermo-primary);
    color: white;
}

.btn-action.btn-consult:hover {
    background: var(--thermo-primary-dark);
    transform: translateY(-2px);
}

.action-icon { font-size: 18px; }

/* Error Card */
.error-card {
    text-align: center;
    padding: 48px;
    background: #ffebee;
    border-radius: 12px;
}

.error-card .error-icon { font-size: 64px; margin-bottom: 16px; }
.error-card h3 { color: #c62828; margin: 0 0 12px; }
.error-card p { color: #b71c1c; margin-bottom: 24px; }

/* Info Block */
.thermo-info-block {
    margin-bottom: 40px;
}

.thermo-info-block h2 {
    text-align: center;
    font-size: 24px;
    color: var(--thermo-text);
    margin-bottom: 24px;
}

.info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 24px;
}

.info-card {
    padding: 28px;
    background: var(--thermo-card-bg);
    border-radius: var(--thermo-radius);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.06);
    text-align: center;
}

.info-card .info-icon { font-size: 48px; margin-bottom: 16px; }

.info-card h4 {
    font-size: 18px;
    color: var(--thermo-text);
    margin: 0 0 12px;
}

.info-card p {
    color: var(--thermo-text-muted);
    margin: 0;
    line-height: 1.6;
}

/* CTA Block */
.thermo-cta {
    background: linear-gradient(135deg, var(--thermo-primary), #ff6d00);
    border-radius: var(--thermo-radius);
    padding: 48px;
    text-align: center;
    margin-bottom: 40px;
}

.thermo-cta h3 {
    font-size: 28px;
    color: white;
    margin: 0 0 12px;
}

.thermo-cta p {
    color: rgba(255, 255, 255, 0.9);
    margin: 0 0 24px;
    font-size: 18px;
}

.thermo-cta .big_btn {
    display: inline-block;
    padding: 16px 32px;
    background: white;
    color: var(--thermo-primary-dark);
    border-radius: 10px;
    font-weight: 600;
    font-size: 18px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.thermo-cta .big_btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
}

/* Related Tools */
.related-tools {
    margin-bottom: 40px;
}

.related-tools h3 {
    font-size: 20px;
    color: var(--thermo-text);
    margin-bottom: 16px;
}

.tools-grid {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
}

.tool-card {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 20px;
    background: #f5f5f5;
    border-radius: 10px;
    text-decoration: none;
    color: var(--thermo-text);
    transition: all 0.2s ease;
}

.tool-card:hover {
    background: #fff3e0;
    transform: translateY(-2px);
}

.tool-icon { font-size: 24px; }
.tool-name { font-weight: 500; }

/* Input Styles */
.thermo-input {
    width: 100%;
    padding: 14px 18px;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    font-size: 16px;
    transition: all 0.2s ease;
    box-sizing: border-box;
}

.thermo-input:focus {
    outline: none;
    border-color: var(--thermo-primary);
    box-shadow: 0 0 0 4px rgba(230, 81, 0, 0.1);
}

.form-label {
    display: block;
    font-weight: 600;
    color: var(--thermo-text);
    margin-bottom: 8px;
}

.form-hint {
    font-size: 13px;
    color: var(--thermo-text-muted);
    margin-top: 6px;
}

/* Responsive */
@media (max-width: 768px) {
    .thermo-calc-page { padding: 20px 12px; }

    .thermo-calc-hero h1 { font-size: 24px; }

    .thermo-calc-container { padding: 20px 16px; }

    .wizard-progress { gap: 20px; }
    .wizard-step .step-label { display: none; }

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

    .shape-grid { grid-template-columns: 1fr; }

    .dimension-grid { grid-template-columns: 1fr; }

    .result-metrics { grid-template-columns: repeat(2, 1fr); }

    .metric-value { font-size: 24px; }

    .result-actions { flex-direction: column; }

    .btn-action { justify-content: center; }
}
