/* ============================================
   GEHALTSAUSGLEICHRECHNER SPECIFIC STYLES
   ============================================ */

/* Wrapper for label and info icon to keep them inline */
.label-with-icon {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}

.label-with-icon label {
    flex: 1;
    margin-bottom: 0;
}

/* Header Section with inline toolbar */
.header-section {
    margin: 0 -2rem 0.25rem -2rem;
    padding: 0 2rem;
    background: white;
}

/* Fairness points styling */
.fairness-points {
    margin-left: 1.5rem;
    margin-bottom: 1rem;
}

.fairness-points p {
    margin-bottom: 0.75rem;
}

.header-section .container-content {
    max-width: var(--container-max-width);
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
}

.page-title {
    font-size: 2rem;
    font-family: var(--font-family-primary);
    font-weight: 700;
    text-transform: none;
    letter-spacing: normal;
    color: var(--color-primary);
    margin: 0;
    text-align: left;
}

.toolbar-actions {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-shrink: 0;
}

.toolbar-btn {
    background: transparent !important;
    border: 2px solid var(--color-primary) !important;
    border-radius: var(--border-radius);
    padding: 0.5rem;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    font-size: 1rem;
    color: var(--color-primary) !important;
    position: relative;
}

.toolbar-btn:hover {
    background: var(--color-primary) !important;
    color: white !important;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.toolbar-btn .material-symbols-outlined {
    font-size: 1.2rem;
    color: inherit !important;
}

.toolbar-btn.toggle-btn {
    padding: 0.5rem 1rem;
}

.toolbar-btn.toggle-btn.active {
    background: var(--color-success) !important;
    border-color: var(--color-success) !important;
    color: white !important;
}

.toolbar-btn.toggle-btn.active:hover {
    background: var(--color-success) !important;
    color: white !important;
}

.toolbar-btn.admin-btn {
    background: rgba(255, 193, 7, 0.1) !important;
    border-color: var(--color-warning) !important;
    color: var(--color-warning) !important;
}

.toolbar-btn.admin-btn:hover {
    background: var(--color-warning) !important;
    color: white !important;
}

.toolbar-btn.help-btn {
    background: transparent !important;
    border-color: var(--color-primary) !important;
    color: var(--color-primary) !important;
}

.toolbar-btn.help-btn:hover {
    background: var(--color-primary) !important;
    color: white !important;
}

.toggle-text, .admin-text, .button-text {
    font-weight: 500;
    white-space: nowrap;
    color: inherit !important;
}

/* Sticky Calculator Toolbar */
.calculator-toolbar {
    position: sticky;
    top: 0;
    z-index: 1001;
    background: white;
    border-bottom: 2px solid var(--color-primary);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    padding: 1rem 0;
    margin: 0 calc(-50vw + 50%) 2rem calc(-50vw + 50%);
    opacity: 0;
    transform: translateY(-100%);
    transition: opacity 0.4s ease, transform 0.4s ease;
    pointer-events: none;
}

.calculator-toolbar.visible {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

.calculator-toolbar.hiding {
    opacity: 0;
    transform: translateY(-100%);
    pointer-events: none;
}

.toolbar-content {
    max-width: var(--container-max-width);
    margin: 0 auto;
    padding: 0 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
}

.toolbar-title {
    font-size: 1.5rem;
    font-family: var(--font-family-primary);
    font-weight: 700;
    text-transform: none;
    letter-spacing: normal;
    color: var(--color-primary);
    margin: 0;
    flex: 1;
}

/* Navbar transition when toolbar takes over */
.navbar {
    transition: transform 0.4s ease, opacity 0.4s ease;
}

.navbar.hidden-by-toolbar {
    transform: translateY(-100%);
    opacity: 0;
}

.navbar.showing {
    transform: translateY(0);
    opacity: 1;
}

/* Admin Test Button */
.admin-test-button {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: rgba(255, 255, 255, 0.2);
    border: 2px solid rgba(255, 255, 255, 0.3);
    color: white;
    font-size: 0.9rem;
    font-weight: 500;
    padding: 0.5rem 1rem;
    border-radius: var(--border-radius);
    cursor: pointer;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
    user-select: none;
    z-index: 1000;
}

.admin-test-button:hover {
    background: rgba(255, 255, 255, 0.3);
    border-color: rgba(255, 255, 255, 0.5);
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.admin-test-button:active {
    transform: translateY(0);
    background: rgba(255, 255, 255, 0.4);
}

.admin-test-button:focus {
    outline: 2px solid rgba(255, 255, 255, 0.6);
    outline-offset: 2px;
}

/* Additional styles specific to Gehaltsausgleich calculator */

/* Accordion - override shared styles to use max-height like rentenausgleichrechner */
.accordion-content {
    padding: 0 1.5rem;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
    display: block !important; /* Override grid from shared CSS */
}

.accordion-item.active .accordion-content {
    padding: 1.5rem;
    max-height: 5000px;
}

/* Chart visualization improvements for income distribution */
.chart-visualization {
    margin-top: 2rem;
}

.charts-container {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
}

.chart-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
}

.chart-header {
    text-align: center;
    padding: 0.5rem 0;
    width: 100%;
}

.chart-header h4 {
    margin: 0;
    font-size: 0.9rem;
    color: var(--color-primary);
    font-family: var(--font-family-primary);
    font-weight: 600;
    text-transform: none;
    letter-spacing: normal;
}

.chart-wrapper {
    /* width and height set dynamically via inline styles */
    background-color: #f8f9fa;
    border-radius: var(--border-radius);
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
    align-self: center;
    min-height: 200px;
    min-width: 200px;
}

.chart-wrapper canvas {
    /* Size controlled by Chart.js and container */
}

.chart-total {
    margin-top: 0.5rem;
    margin-bottom: 0.3rem;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--color-primary);
    text-align: center;
}

.chart-legend {
    margin-top: 0.5rem;
    text-align: center;
    font-size: 0.75rem;
    min-height: 60px;
}

.chart-legend div {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 3px;
    line-height: 1.2;
}

.chart-legend span {
    margin-left: 0.5rem;
}

/* Person workload display */
.person-workload {
    margin: 1rem 0;
    padding: 1rem;
    border-radius: var(--border-radius);
}

.person-a-workload {
    background: linear-gradient(90deg, rgba(255, 224, 4, 0.1) 0%, transparent 100%);
    border-left: 4px solid var(--color-person-a);
}

.person-b-workload {
    background: linear-gradient(90deg, rgba(167, 219, 223, 0.1) 0%, transparent 100%);
    border-left: 4px solid var(--color-person-b);
}

.person-workload h4 {
    margin-top: 0;
    margin-bottom: 0.5rem;
    font-size: 1.1rem;
}

.person-workload p {
    margin: 0.3rem 0;
    font-size: 0.9rem;
}

/* Income intro text */
.income-intro {
    margin-bottom: 1.5rem;
    color: var(--color-text);
    font-size: 0.95rem;
}

/* Income Timeline Container */
.income-timeline {
    background: #f8f9fa;
    padding: 1.75rem;
    border-radius: var(--border-radius);
    margin: 1.5rem 0 3rem 0;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

/* Timeline Section */
.timeline-section {
    margin-bottom: 1.75rem;
}

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

/* Timeline Header with decorative line */
.timeline-header {
    display: flex;
    align-items: center;
    margin-bottom: 1rem;
}

.timeline-header::before {
    content: '';
    flex: 0 0 auto;
    width: 40px;
    height: 2px;
    background: var(--color-primary);
    margin-right: 10px;
}

.timeline-header::after {
    content: '';
    flex: 1;
    height: 2px;
    background: #e0e0e0;
    margin-left: 10px;
}

.timeline-label {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--color-primary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    white-space: nowrap;
}

/* Color coding for different timeline sections */
.timeline-original .timeline-header::before {
    background: #757575;
}

.timeline-original .timeline-label {
    color: #757575;
}

.timeline-current .timeline-header::before {
    background: #ff9800;
}

.timeline-current .timeline-label {
    color: #ff9800;
}

.timeline-compensation .timeline-header::before {
    background: #4caf50;
}

.timeline-compensation .timeline-label {
    color: #4caf50;
}

/* Timeline Content (the text) */
.timeline-content {
    padding-left: 0;
    font-size: 0.95rem;
    line-height: 1.7;
    color: var(--color-text);
}

.timeline-content p {
    margin: 0;
}

.timeline-content strong {
    font-weight: 600;
    color: var(--color-primary);
}

/* Change Indicators (inline in text) */
.change-positive {
    color: #f57c00;
    font-weight: 600;
    white-space: nowrap;
}

.change-negative {
    color: #d32f2f;
    font-weight: 600;
    white-space: nowrap;
}

/* Childcare summary section */
.childcare-summary {
    background: var(--color-light);
    padding: 1.5rem;
    border-radius: var(--border-radius);
    margin: 1rem 0;
}

.childcare-summary p {
    margin: 0.5rem 0;
}

/* Example section styles */
.example-family {
    background: var(--color-light);
    padding: 1.5rem;
    border-radius: var(--border-radius);
    margin-bottom: 1.5rem;
}

.example-person {
    margin: 1.5rem 0;
    padding: 1.5rem;
    border-radius: var(--border-radius);
    background: white;
}

.example-person.person-a {
    border-left: 4px solid var(--color-person-a);
}

.example-person.person-b {
    border-left: 4px solid var(--color-person-b);
}

.example-comparison {
    margin: 1rem 0;
}

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

.before ul,
.after ul {
    list-style-type: none;
    padding-left: 0;
    margin: 0.5rem 0;
}

.before li,
.after li {
    margin-bottom: 0.3rem;
}

.example-childcare {
    background: white;
    padding: 1.5rem;
    border-radius: var(--border-radius);
    border-left: 4px solid var(--color-success);
}

.example-childcare ul {
    list-style-type: none;
    padding-left: 0;
}

/* Calculation step styles for examples */
.example-principle {
    background: var(--color-light);
    padding: 1.5rem;
    border-radius: var(--border-radius);
    margin-bottom: 1.5rem;
}

.calculation-step {
    margin: 1.5rem 0;
}

.calculation-detail {
    padding: 1rem;
    background: white;
    border-radius: var(--border-radius);
    border-left: 2px solid #e0e0e0;
    margin: 0.5rem 0;
}

.calculation-result {
    margin: 1.5rem 0;
    padding: 1.5rem;
    background: rgba(255, 224, 4, 0.1);
    border-radius: var(--border-radius);
    border-left: 4px solid var(--color-person-a);
}

.result-highlight {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--color-primary);
    margin-top: 1rem;
}

/* FAQ styles */
.faq-item {
    margin-bottom: 1.5rem;
}

.faq-question {
    font-weight: 600;
    color: var(--color-primary);
    margin-bottom: 0.5rem;
    font-family: var(--font-family-primary);
}

/* Override some base styles for better integration */
h3 {
    color: var(--color-primary);
    border-bottom: 2px solid var(--color-primary);
    padding-bottom: 0.5rem;
    margin-bottom: 1.5rem;
    margin-top: 2rem;
}

/* Responsive adjustments */
@media (max-width: 767px) {
    /* Timeline adjustments for mobile */
    .income-timeline {
        padding: 1.25rem;
        margin: 1rem 0 2rem 0;
    }
    
    .timeline-header::before {
        width: 30px;
    }
    
    .timeline-content {
        font-size: 0.9rem;
        line-height: 1.6;
    }
    
    .timeline-label {
        font-size: 0.85rem;
    }
    
    .timeline-section {
        margin-bottom: 1.5rem;
    }
    
    /* Charts */
    .charts-container {
        flex-direction: column;
        gap: 2rem;
    }
    
    .chart-item {
        width: 100%;
        min-height: 300px;
        display: flex;
        flex-direction: column;
        align-items: center;
    }
    
    .chart-header {
        padding: 0.75rem 0;
        width: 100%;
    }
    
    .chart-header h4 {
        font-size: 0.85rem;
    }
    
    .chart-wrapper {
        /* width and height set dynamically via inline styles */
        margin: 0 auto;
        min-height: 200px;
        min-width: 200px;
        flex-shrink: 0;
    }
    
    /* Accordion mobile adjustments */
    .accordion-content {
        padding: 0 1rem;
    }
    
    .accordion-item.active .accordion-content {
        padding: 1rem;
    }
    
    .before-after {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .chart-legend {
        font-size: 0.7rem;
        min-height: 50px;
    }
    
    /* Header section mobile adjustments */
    .header-section {
        margin: 0 -1rem 1.5rem -1rem;
        padding: 0 1rem;
    }
    
    .header-section .container-content {
        flex-direction: column;
        align-items: stretch;
        gap: 1rem;
    }
    
    .page-title {
        font-size: 2rem;
        text-align: center;
    }
    
    .toolbar-actions {
        justify-content: center;
        gap: 0.5rem;
    }
    
    .toolbar-btn {
        padding: 0.4rem 0.6rem;
        font-size: 0.8rem;
    }
    
    .toolbar-btn .material-symbols-outlined {
        font-size: 1rem;
    }
    
    .toggle-text {
        font-size: 0.75rem;
    }
    
    /* Sticky toolbar mobile adjustments */
    .calculator-toolbar {
        margin: 0 calc(-50vw + 50%) 1.5rem calc(-50vw + 50%);
        padding: 1rem 0;
    }
    
    .toolbar-content {
        padding: 0 1rem;
        flex-direction: column;
        gap: 0.75rem;
        align-items: stretch;
    }
    
    .toolbar-title {
        font-size: 1.2rem;
        text-align: center;
    }
}

/* Modal Styles */
.help-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 2000;
    display: none;
    justify-content: center;
    align-items: center;
    padding: 1rem;
}

.help-modal.show {
    display: flex;
}

.help-modal-content {
    background: white;
    border-radius: var(--border-radius);
    padding: 0;
    max-width: 800px;
    width: 100%;
    max-height: 95vh;
    overflow: hidden;
    position: relative;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.help-modal-header {
    position: absolute;
    top: 0;
    right: 0;
    z-index: 10;
    padding: 0.5rem;
}

.help-modal-close {
    background: rgba(255, 255, 255, 0.9);
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: #666;
    padding: 0;
    width: 35px;
    height: 35px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.help-modal-close:hover {
    background: rgba(255, 255, 255, 1);
    color: #333;
}

.calendly-button {
    display: inline-block;
    background: var(--color-primary);
    color: white;
    padding: 0.75rem 1.5rem;
    border-radius: var(--border-radius);
    text-decoration: none;
    font-weight: 600;
    transition: background 0.3s ease;
    text-align: center;
    width: 100%;
    margin-top: 1rem;
}

.calendly-button:hover {
    background: var(--color-primary);
    color: white;
    text-decoration: none;
}

.calendly-embed-container {
    margin: 0 !important;
    margin-top: 0 !important;
    border-radius: var(--border-radius);
    overflow: hidden;
    height: 100%;
}

.calendly-inline-widget {
    border-radius: var(--border-radius);
}

/* Mobile adjustments for modal */
@media (max-width: 767px) {
    .help-modal-content {
        max-width: 95vw;
        padding: 0;
        margin: 1rem;
    }
    
    .calendly-inline-widget {
        height: 600px !important;
        min-width: 280px !important;
    }
}