/* Retirement Calculator - Polish Market */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: #333;
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    min-height: 100vh;
    padding: 20px;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    background: white;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

/* Header */
header {
    background: linear-gradient(135deg, #2c3e50 0%, #4a6fa5 100%);
    color: white;
    padding: 30px;
    text-align: center;
}

header h1 {
    font-size: 2.5rem;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
}

header .subtitle {
    font-size: 1.2rem;
    opacity: 0.9;
    font-weight: 300;
}

/* Main Content */
.main-content {
    display: grid;
    grid-template-columns: 1fr 1.5fr;
    gap: 30px;
    padding: 30px;
}

@media (max-width: 1200px) {
    .main-content {
        grid-template-columns: 1fr;
    }
}

/* Cards */
.card {
    background: white;
    border-radius: 10px;
    padding: 25px;
    margin-bottom: 25px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
    border: 1px solid #e1e5eb;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
}

.card h2 {
    color: #2c3e50;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid #4a6fa5;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.4rem;
}

.card h3 {
    color: #4a6fa5;
    margin: 20px 0 15px 0;
    font-size: 1.1rem;
    display: flex;
    align-items: center;
    gap: 8px;
}

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

.form-group label {
    display: block;
    margin-bottom: 8px;
    color: #2c3e50;
    font-weight: 500;
    font-size: 0.95rem;
}

.input-with-unit {
    display: flex;
    align-items: center;
    gap: 10px;
}

.input-with-unit input {
    flex: 1;
    padding: 12px 15px;
    border: 2px solid #e1e5eb;
    border-radius: 8px;
    font-size: 1rem;
    transition: all 0.3s ease;
    background: #f8f9fa;
}

.input-with-unit input:focus {
    outline: none;
    border-color: #4a6fa5;
    background: white;
    box-shadow: 0 0 0 3px rgba(74, 111, 165, 0.1);
}

.input-with-unit .unit {
    color: #6c757d;
    font-weight: 500;
    min-width: 40px;
}

/* Account Sections */
.account-section {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 20px;
    border-left: 4px solid #4a6fa5;
}

.account-section:last-child {
    margin-bottom: 0;
}

.account-section:nth-child(2) {
    border-left-color: #6B8E23;
}

.account-section:nth-child(3) {
    border-left-color: #FF8C00;
}

.account-section:nth-child(4) {
    border-left-color: #8B4513;
}

/* Calculate Button */
.calculate-btn {
    width: 100%;
    padding: 18px;
    background: linear-gradient(135deg, #27ae60 0%, #2ecc71 100%);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 1.2rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin-top: 10px;
}

.calculate-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 20px rgba(46, 204, 113, 0.3);
}

.calculate-btn:active {
    transform: translateY(-1px);
}

/* Chart Container */
.chart-container {
    position: relative;
    height: 400px;
    width: 100%;
    margin: 20px 0;
}

.retirement-annotation {
    position: absolute;
    top: 0;
    bottom: 0;
    width: 2px;
    background: #FF0000;
    pointer-events: none;
}

.retirement-annotation span {
    position: absolute;
    top: 10px;
    left: 10px;
    background: rgba(255, 0, 0, 0.9);
    color: white;
    padding: 5px 10px;
    border-radius: 5px;
    font-size: 0.9rem;
    white-space: nowrap;
}

/* Summary Statistics */
.summary-stats {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
    margin: 25px 0;
}

@media (max-width: 768px) {
    .summary-stats {
        grid-template-columns: 1fr;
    }
}

.stat-box {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    padding: 20px;
    border-radius: 10px;
    text-align: center;
    border: 1px solid #dee2e6;
}

.stat-label {
    font-size: 0.9rem;
    color: #6c757d;
    margin-bottom: 10px;
    font-weight: 500;
}

.stat-value {
    font-size: 1.8rem;
    font-weight: 700;
    color: #2c3e50;
}

.stat-value.success-high {
    color: #27ae60;
}

.stat-value.success-medium {
    color: #f39c12;
}

.stat-value.success-low {
    color: #e74c3c;
}

/* Results Table */
.results-table-container {
    margin-top: 25px;
    overflow-x: auto;
}

#resultsTable {
    width: 100%;
    border-collapse: collapse;
    margin-top: 10px;
}

#resultsTable thead {
    background: linear-gradient(135deg, #4a6fa5 0%, #2c3e50 100%);
    color: white;
}

#resultsTable th {
    padding: 15px;
    text-align: left;
    font-weight: 600;
    font-size: 0.95rem;
}

#resultsTable tbody tr {
    border-bottom: 1px solid #e1e5eb;
    transition: background-color 0.2s ease;
}

#resultsTable tbody tr:hover {
    background-color: #f8f9fa;
}

#resultsTable tbody tr.retirement-row {
    background-color: #fff3cd;
    font-weight: 600;
}

#resultsTable tbody tr.depleted-row {
    background-color: #f8d7da;
    color: #721c24;
}

#resultsTable tbody tr.depleted-row td {
    border-color: #f5c6cb;
}

#resultsTable td {
    padding: 12px 15px;
    color: #495057;
}

/* Footer */
footer {
    background: #f8f9fa;
    padding: 25px;
    text-align: center;
    border-top: 1px solid #e1e5eb;
    color: #6c757d;
    font-size: 0.95rem;
}

footer i {
    color: #4a6fa5;
    margin-right: 8px;
}

/* Responsive Design */
@media (max-width: 768px) {
    body {
        padding: 10px;
    }

    header {
        padding: 20px;
    }

    header h1 {
        font-size: 1.8rem;
        flex-direction: column;
        gap: 10px;
    }

    .main-content {
        padding: 20px;
        gap: 20px;
    }

    .card {
        padding: 20px;
    }

    .input-with-unit {
        flex-direction: column;
        align-items: stretch;
        gap: 5px;
    }

    .input-with-unit .unit {
        text-align: right;
    }

    .chart-container {
        height: 300px;
    }
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.card {
    animation: fadeIn 0.5s ease-out;
}

/* Scrollbar Styling */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

/* Error states */
.input-error {
    border-color: #e74c3c !important;
    background-color: #fdf2f2 !important;
}

.error-message {
    color: #e74c3c;
    font-size: 0.85rem;
    margin-top: 5px;
    display: flex;
    align-items: center;
    gap: 5px;
}

.input-with-unit.error .unit {
    color: #e74c3c;
}

/* Print Styles */
@media print {
    .calculate-btn,
    footer {
        display: none;
    }

    .card {
        box-shadow: none;
        border: 1px solid #ddd;
    }

    .main-content {
        grid-template-columns: 1fr;
    }
}