/* Global variables */
:root {
    --primary-color: #0d1f3c;
    --accent-color: #ffc445;
    --background-light: #f7f9fc;
    --card-bg: #ffffff;
    --text-dark: #2c3e50;
    --text-muted: #7f8c8d;
    --border-color: #e0e6ed;
}

html, body {
    margin: 0;
    padding: 0;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    color: var(--text-dark);
    background: var(--background-light);
    height: 100%;
}

/* Header */
/* Header */
.app-header {
    background: var(--card-bg);
    color: var(--primary-color);
    padding: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    border-bottom: 1px solid var(--border-color);
}

.logo {
    display: flex;
    align-items: center;
    gap: 16px;
}

.logo-img {
    width: 48px;
    height: 48px;
}

.title-group h1 {
    margin: 0;
    font-size: 1.5rem;
    font-weight: 600;
}

.title-group p {
    margin: 2px 0 0;
    font-size: 0.9rem;
    opacity: 0.8;
}

/* Main layout */
.app-main {
    display: flex;
    gap: 24px;
    max-width: 1200px;
    margin: 30px auto;
    padding: 0 20px;
}

.sidebar {
    flex: 2;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

/* Tab navigation */
.tab-nav {
    display: flex;
    gap: 10px;
    background: var(--card-bg);
    border-radius: 6px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

.tab-btn {
    flex: 1;
    padding: 12px 10px;
    border: none;
    background: var(--card-bg);
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--text-dark);
    cursor: pointer;
    transition: background-color 0.2s, color 0.2s;
}

.tab-btn:not(.active):hover {
    background: #f1f5fa;
}

.tab-btn.active {
    background: var(--primary-color);
    color: #fff;
}

/* Tab content wrapper */
.tab-content-wrapper {
    background: var(--card-bg);
    border-radius: 6px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    padding: 20px;
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

.tab-content h2 {
    margin-top: 0;
    font-size: 1.25rem;
    color: var(--primary-color);
    margin-bottom: 16px;
}

.tab-desc {
    font-size: 0.9rem;
    color: var(--text-muted);
    margin-bottom: 12px;
}

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

.form-group label {
    display: block;
    font-size: 0.9rem;
    font-weight: 600;
    margin-bottom: 6px;
}

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

input[type="range"] {
    flex: 1;
    height: 4px;
    appearance: none;
    background: var(--border-color);
    border-radius: 2px;
    outline: none;
}

input[type="range"]::-webkit-slider-thumb {
    appearance: none;
    width: 14px;
    height: 14px;
    background: var(--primary-color);
    border-radius: 50%;
    cursor: pointer;
}

input[type="range"]::-moz-range-thumb {
    width: 14px;
    height: 14px;
    background: var(--primary-color);
    border-radius: 50%;
    cursor: pointer;
}

input[type="number"] {
    width: 100px;
    padding: 8px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    font-size: 0.95rem;
}

.category-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 12px;
}

.category-item label {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 4px;
}

.category-item input[type="number"] {
    width: 100%;
    padding: 7px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    font-size: 0.9rem;
}

/* Results Panel */
.results-panel {
    flex: 1;
    background: var(--card-bg);
    border-radius: 6px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 20px;
    position: sticky;
    top: 30px;
    height: max-content;
}

.profit-card {
    background: var(--primary-color);
    color: #fff;
    border-radius: 6px;
    padding: 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.profit-card h2 {
    margin: 0;
    font-size: 1.2rem;
    font-weight: 600;
}

.profit-value {
    margin: 10px 0;
    font-size: 2rem;
    font-weight: 700;
    color: var(--accent-color);
}

.subtitle {
    margin: 0;
    font-size: 0.8rem;
    opacity: 0.8;
    color: #fff;
}

.metrics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 12px;
}

.metric-box {
    background: var(--background-light);
    padding: 12px;
    border-radius: 4px;
    text-align: center;
    box-shadow: inset 0 0 0 1px var(--border-color);
}

.metric-box h3 {
    margin: 0;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--primary-color);
    margin-bottom: 4px;
}

.metric-box span {
    font-size: 1.3rem;
    font-weight: 600;
    color: var(--text-dark);
}

.cost-breakdown {
    background: var(--background-light);
    border-radius: 6px;
    padding: 16px;
    box-shadow: inset 0 0 0 1px var(--border-color);
}

.cost-breakdown h3 {
    margin-top: 0;
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--primary-color);
    margin-bottom: 12px;
}

.cost-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.9rem;
    padding: 6px 0;
    border-bottom: 1px solid var(--border-color);
}

.cost-item.total {
    font-weight: 700;
}

.cost-item:last-child {
    border-bottom: none;
}

/* PDF button for premium report */
.pdf-btn {
    width: 100%;
    background: var(--accent-color);
    color: var(--primary-color);
    border: none;
    padding: 12px;
    font-size: 1rem;
    font-weight: 600;
    border-radius: 4px;
    cursor: pointer;
    margin-top: 20px;
    transition: background-color 0.2s;
}

.pdf-btn:hover {
    background: #eab030;
}

/* Premium details form styling */
.premium-form {
    background: var(--card-bg);
    border-radius: 6px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    padding: 20px;
    margin-bottom: 16px;
}

.premium-form h3 {
    margin-top: 0;
    margin-bottom: 12px;
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--primary-color);
}

.premium-form .form-group label {
    display: block;
    font-size: 0.9rem;
    font-weight: 600;
    margin-bottom: 6px;
}

.premium-form input[type="text"],
.premium-form textarea,
.premium-form input[type="file"] {
    width: 100%;
    padding: 8px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    font-size: 0.95rem;
}

.premium-form textarea {
    resize: vertical;
}

/* Footer */
.app-footer {
    text-align: center;
    padding: 20px 10px;
    font-size: 0.85rem;
    color: var(--text-muted);
}

/* Footer link styling */
.app-footer a {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 600;
}

.app-footer a:hover {
    text-decoration: underline;
    color: var(--accent-color);
}

/* Impressum page layout */
.impressum-main {
    max-width: 800px;
    margin: 40px auto;
    padding: 0 20px;
}

.impressum-content {
    background: var(--card-bg);
    border-radius: 6px;
    padding: 24px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.06);
}

.impressum-content h2 {
    margin-top: 0;
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 12px;
}

.impressum-content p {
    margin: 8px 0;
    font-size: 1rem;
    color: var(--text-dark);
    line-height: 1.5;
}

/* Page banner */
.page-banner {
    background: var(--card-bg);
    border-radius: 6px;
    padding: 24px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.06);
    margin-bottom: 20px;
    text-align: left;
}

.page-banner h2 {
    margin: 0 0 8px;
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--primary-color);
}

.page-banner .highlight {
    color: var(--accent-color);
}

.page-banner p {
    margin: 0;
    font-size: 1rem;
    /* Increase line height slightly for readability */
    line-height: 1.6;
    /* Use the dark text color instead of muted grey for better contrast */
    color: var(--text-dark);
}

/* Responsive adjustments */
@media (max-width: 900px) {
    .app-main {
        flex-direction: column;
    }
    .results-panel {
        position: static;
        width: 100%;
    }
}