/* ========================================
   IMMOBILIEN KALKULATOR - STYLES.CSS
   ======================================== */

:root {
    --color-primary: #00BCD4;
    --color-primary-light: #4DD0E1;
    --color-primary-dark: #0097A7;
    --color-secondary: #1e1e2e;
    --color-text: #e0e0e0;
    --color-text-light: #b0b0b0;
    --color-bg: #0f0f0f;
    --color-surface: #1a1a1a;
    --color-border: rgba(0, 188, 212, 0.2);
    --color-success: #4CAF50;
    --color-warning: #FF9800;
    --color-error: #F44336;
    --color-hover: rgba(0, 188, 212, 0.1);

    --transition: 0.3s ease;
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.5);
    --radius: 12px;
    --radius-sm: 6px;
}

body.light-theme {
    --color-primary: #045;
    --color-primary-light: #1a7a9c;
    --color-primary-dark: #033849;
    --color-text: #2c3e50;
    --color-text-light: #7f8c8d;
    --color-bg: #f8f9fa;
    --color-surface: #ffffff;
    --color-border: rgba(4, 69, 130, 0.15);
    --color-hover: rgba(4, 69, 130, 0.05);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: var(--color-bg);
    color: var(--color-text);
    line-height: 1.6;
    transition: background var(--transition), color var(--transition);
}

/* ========================================
   HEADER STYLES
   ======================================== */

.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 2rem;
    background: linear-gradient(135deg, rgba(0, 188, 212, 0.1) 0%, rgba(0, 97, 167, 0.1) 100%);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--color-border);
    box-shadow: var(--shadow-sm);
    position: sticky;
    top: 0;
    z-index: 100;
}

body.light-theme .header {
    background: linear-gradient(135deg, rgba(4, 69, 130, 0.05) 0%, rgba(26, 122, 156, 0.05) 100%);
}

.header-left h1 {
    font-size: 1.8rem;
    margin-bottom: 0.2rem;
    background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-primary-light) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-weight: 700;
}

.header-left p {
    font-size: 0.9rem;
    color: var(--color-text-light);
    font-weight: 300;
}

.header-right {
    display: flex;
    gap: 1rem;
}

.controls {
    display: flex;
    gap: 1rem;
    align-items: center;
}

.btn-icon {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    cursor: pointer;
    font-size: 1.2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition);
    box-shadow: var(--shadow-sm);
}

.btn-icon:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-md);
    background: var(--color-hover);
    border-color: var(--color-primary);
}

.language-toggle {
    display: flex;
    gap: 0.3rem;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: 50px;
    padding: 0.25rem;
    box-shadow: var(--shadow-sm);
}

.lang-btn {
    background: transparent;
    border: none;
    padding: 0.5rem 0.8rem;
    cursor: pointer;
    border-radius: 50px;
    transition: all var(--transition);
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--color-text-light);
}

.lang-btn.active {
    background: var(--color-primary);
    color: white;
    box-shadow: 0 2px 8px rgba(0, 188, 212, 0.3);
}

.lang-btn:hover:not(.active) {
    background: var(--color-hover);
}

/* ========================================
   MAIN CONTENT LAYOUT
   ======================================== */

.container {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.main-content {
    flex: 1;
    padding: 2rem;
    max-width: 1400px;
    margin: 0 auto;
    width: 100%;
}

/* ========================================
   SECTIONS STYLES
   ======================================== */

.section {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    padding: 2rem;
    margin-bottom: 2rem;
    box-shadow: var(--shadow-sm);
    animation: fadeIn 0.5s ease;
}

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

.section-title {
    font-size: 1.3rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
    color: var(--color-primary);
    border-bottom: 2px solid var(--color-primary);
    padding-bottom: 0.8rem;
    display: inline-block;
}

.section-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    margin-bottom: 0;
}

.subsection h3 {
    font-size: 1.1rem;
    margin-bottom: 1rem;
    color: var(--color-primary);
    font-weight: 600;
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
}

/* ========================================
   FORM ELEMENTS
   ======================================== */

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

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

.input-wrapper {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.slider {
    flex: 1;
    height: 6px;
    border-radius: 3px;
    background: linear-gradient(to right, var(--color-primary-dark), var(--color-primary), var(--color-primary-light));
    outline: none;
    -webkit-appearance: none;
    cursor: pointer;
}

.slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--color-primary);
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(0, 188, 212, 0.4);
    transition: all var(--transition);
}

.slider::-webkit-slider-thumb:hover {
    transform: scale(1.2);
    box-shadow: 0 4px 16px rgba(0, 188, 212, 0.6);
}

.slider::-moz-range-thumb {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--color-primary);
    cursor: pointer;
    border: none;
    box-shadow: 0 2px 8px rgba(0, 188, 212, 0.4);
    transition: all var(--transition);
}

.slider::-moz-range-thumb:hover {
    transform: scale(1.2);
    box-shadow: 0 4px 16px rgba(0, 188, 212, 0.6);
}

.input-number,
.input-text,
.input-select,
.input-small {
    padding: 0.75rem;
    background: rgba(0, 188, 212, 0.05);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    color: var(--color-text);
    font-size: 0.95rem;
    transition: all var(--transition);
    font-family: 'Courier New', monospace;
}

.input-number:focus,
.input-text:focus,
.input-select:focus,
.input-small:focus {
    outline: none;
    background: rgba(0, 188, 212, 0.1);
    border-color: var(--color-primary);
    box-shadow: 0 0 12px rgba(0, 188, 212, 0.2);
}

.input-small {
    padding: 0.5rem;
    font-size: 0.85rem;
    width: 100px;
}

.radio-group {
    display: flex;
    gap: 1rem;
}

.radio-group label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    font-weight: 500;
}

.radio-group input[type="radio"],
.form-group input[type="checkbox"] {
    accent-color: var(--color-primary);
    cursor: pointer;
    width: 18px;
    height: 18px;
}

.info-text {
    color: var(--color-text-light);
    font-size: 0.85rem;
    margin-top: 0.25rem;
}

/* ========================================
   RESULTS SECTIONS
   ======================================== */

.results-section {
    margin-top: 2rem;
}

.result-card {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    box-shadow: var(--shadow-sm);
    cursor: pointer;
    transition: all var(--transition);
}

.result-card:hover {
    box-shadow: var(--shadow-md);
    border-color: var(--color-primary);
    transform: translateY(-2px);
}

.result-card[open] {
    box-shadow: var(--shadow-md);
    border-color: var(--color-primary);
}

.result-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--color-primary);
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    user-select: none;
}

.result-title::after {
    content: '▼';
    font-size: 0.8rem;
    transition: transform var(--transition);
}

.result-card[open] .result-title::after {
    transform: rotate(180deg);
}

.result-content {
    padding-top: 1rem;
    margin-top: 1rem;
    border-top: 1px solid var(--color-border);
}

.result-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 0;
    border-bottom: 1px solid rgba(0, 188, 212, 0.1);
    font-size: 0.95rem;
}

.result-row:last-child {
    border-bottom: none;
}

.result-row.bold {
    font-weight: 700;
    background: rgba(0, 188, 212, 0.05);
    padding: 1rem 0.75rem;
    margin: 0.5rem 0;
    border-radius: 4px;
}

.result-value {
    font-family: 'Courier New', monospace;
    font-weight: 600;
    color: var(--color-primary);
    text-align: right;
    min-width: 120px;
}

.result-section-title {
    font-weight: 700;
    color: var(--color-primary);
    margin-top: 1rem;
    margin-bottom: 0.5rem;
    font-size: 0.95rem;
}

/* ========================================
   TABLES
   ======================================== */

.result-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 1rem;
    font-size: 0.9rem;
}

.result-table thead {
    background: rgba(0, 188, 212, 0.1);
    border-bottom: 2px solid var(--color-primary);
}

.result-table th {
    padding: 0.75rem;
    text-align: right;
    font-weight: 700;
    color: var(--color-primary);
}

.result-table th:first-child {
    text-align: left;
}

.result-table td {
    padding: 0.75rem;
    text-align: right;
    border-bottom: 1px solid var(--color-border);
    font-family: 'Courier New', monospace;
}

.result-table td:first-child {
    text-align: left;
    font-weight: 600;
}

.result-table tbody tr:nth-child(even) {
    background: rgba(0, 188, 212, 0.02);
}

.result-table tbody tr:hover {
    background: var(--color-hover);
}

.result-table tbody tr.positive {
    color: var(--color-success);
}

.result-table tbody tr.negative {
    color: var(--color-error);
}

/* ========================================
   CASHFLOW SECTION
   ======================================== */

.cashflow-table {
    background: rgba(0, 188, 212, 0.05);
    border-radius: var(--radius-sm);
    padding: 1rem;
    font-size: 0.95rem;
}

.cashflow-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--color-border);
}

.cashflow-row:last-child {
    border-bottom: none;
}

.cashflow-row.bold {
    font-weight: 700;
    padding: 1rem;
    background: rgba(0, 188, 212, 0.1);
    margin-top: 0.5rem;
    border-radius: 4px;
}

.cashflow-row .result-value {
    min-width: 100px;
}

/* ========================================
   FOOTER STYLES
   ======================================== */

.footer {
    background: linear-gradient(135deg, rgba(0, 188, 212, 0.1) 0%, rgba(0, 97, 167, 0.1) 100%);
    border-top: 1px solid var(--color-border);
    padding: 2rem;
    display: flex;
    justify-content: center;
    gap: 1.5rem;
    margin-top: 3rem;
    box-shadow: inset 0 2px 8px rgba(0, 0, 0, 0.1);
}

body.light-theme .footer {
    background: linear-gradient(135deg, rgba(4, 69, 130, 0.05) 0%, rgba(26, 122, 156, 0.05) 100%);
}

.btn-footer {
    padding: 0.75rem 1.5rem;
    border: 1px solid var(--color-border);
    border-radius: 50px;
    background: var(--color-surface);
    color: var(--color-text);
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition);
    box-shadow: var(--shadow-sm);
    font-size: 0.95rem;
}

.btn-footer:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-md);
    border-color: var(--color-primary);
    color: var(--color-primary);
}

.btn-footer.btn-primary {
    background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-primary-light) 100%);
    color: white;
    border-color: var(--color-primary);
}

.btn-footer.btn-primary:hover {
    box-shadow: 0 4px 16px rgba(0, 188, 212, 0.4);
    color: white;
}

/* ========================================
   RESPONSIVENESS
   ======================================== */

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

    .header {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }

    .header-left h1 {
        font-size: 1.5rem;
    }
}

@media (max-width: 768px) {
    .main-content {
        padding: 1rem;
    }

    .section {
        padding: 1rem;
    }

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

    .header {
        padding: 1rem;
    }

    .header-left h1 {
        font-size: 1.3rem;
    }

    .header-left p {
        font-size: 0.8rem;
    }

    .footer {
        flex-direction: column;
        gap: 0.75rem;
    }

    .btn-footer {
        width: 100%;
    }

    .result-row,
    .cashflow-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }

    .result-value,
    .cashflow-row .result-value {
        text-align: left;
    }

    .result-table {
        font-size: 0.8rem;
    }

    .result-table th,
    .result-table td {
        padding: 0.5rem;
    }
}

@media (max-width: 480px) {
    .header-left h1 {
        font-size: 1.1rem;
    }

    .section-title {
        font-size: 1rem;
    }

    .form-group label {
        font-size: 0.9rem;
    }

    .input-number,
    .input-text,
    .input-select {
        font-size: 0.9rem;
        padding: 0.6rem;
    }

    .result-value {
        font-size: 0.85rem;
    }
}

/* ========================================
   LIGHT THEME OVERRIDES
   ======================================== */

body.light-theme .result-card {
    background: #fafafa;
}

body.light-theme .input-number,
body.light-theme .input-text,
body.light-theme .input-select,
body.light-theme .input-small {
    background: rgba(4, 69, 130, 0.03);
}

body.light-theme .result-row.bold,
body.light-theme .cashflow-row.bold {
    background: rgba(4, 69, 130, 0.08);
}

body.light-theme .result-table thead {
    background: rgba(4, 69, 130, 0.08);
}

body.light-theme .result-table tbody tr:nth-child(even) {
    background: rgba(4, 69, 130, 0.03);
}
