/**
 * V6.5 Mobile First Enhancement CSS
 * 
 * IMMOBILIENRING DESIGN SYSTEM - 100% STRIKT
 * 
 * Farbpalette (EXAKT):
 * - IR Rot (Pantone 199 C): #C3003A
 * - IR Grau (Pantone 404 C): #736D64
 * - Font: Inter
 * - KEINE abgerundeten Ecken!
 * 
 * Dieses CSS ERWEITERT das bestehende Tailwind output.css
 * Es überschreibt NICHTS, es fügt nur Mobile-Optimierungen hinzu
 */

/* ============================================
   CSS VARIABLES (konsistent mit tailwind.config.js)
   ============================================ */

:root {
    /* Touch Targets für Mobile */
    --touch-target-min: 44px;
    --touch-target-comfortable: 48px;

    /* Safe Areas (iPhone X+) */
    --safe-area-bottom: env(safe-area-inset-bottom, 0);
}


/* ============================================
   GLOBAL: Eckig bleiben (wie V6)
   ============================================ */

* {
    border-radius: 0 !important;
}


/* ============================================
   MOBILE OPTIMIERUNGEN (< 768px)
   ============================================ */

@media (max-width: 767px) {

    /* Größere Touch-Targets auf Mobile */
    input[type="text"],
    input[type="number"],
    input[type="date"],
    select,
    button {
        min-height: var(--touch-target-min);
        font-size: 16px;
        /* Verhindert iOS Zoom */
    }

    /* Tab-Kacheln: 2 Spalten auf Mobile */
    [role="tablist"] {
        grid-template-columns: repeat(2, 1fr) !important;
    }

    /* Padding für Container */
    .container {
        padding-left: 12px;
        padding-right: 12px;
    }

    /* Hero kleiner auf Mobile */
    section.relative.h-64 {
        height: 180px;
    }

    section.relative.h-64 h1 {
        font-size: 1.5rem;
    }
}


/* ============================================
   ACCORDION COMPONENT (für Zu-/Abschläge)
   ============================================ */

.accordion-group {
    border: 1px solid #eeede9;
    margin-bottom: 8px;
}

.accordion-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: 12px 16px;
    background: white;
    border: none;
    cursor: pointer;
    text-align: left;
    transition: background-color 0.2s;
}

.accordion-header:hover {
    background-color: #f7f7f6;
}

.accordion-header:active {
    background-color: #eeede9;
}

.accordion-title {
    font-weight: 600;
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: #383532;
}

.accordion-count {
    font-size: 0.75rem;
    color: #736D64;
    margin-left: 8px;
}

.accordion-icon {
    color: #736D64;
    transition: transform 0.2s;
    font-size: 12px;
}

.accordion-group.open .accordion-icon {
    transform: rotate(180deg);
}

.accordion-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease-out;
}

.accordion-group.open .accordion-content {
    max-height: 2000px;
}


/* ============================================
   CHECKBOX ROW (für Zu-/Abschläge)
   ============================================ */

.checkbox-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 16px;
    background: white;
    border-bottom: 1px solid #eeede9;
    cursor: pointer;
    transition: background-color 0.15s;
    min-height: var(--touch-target-min);
}

.checkbox-row:hover {
    background-color: #f7f7f6;
}

.checkbox-row:active {
    background-color: #eeede9;
}

.checkbox-row.selected {
    background-color: #fdf2f4;
    /* ir-red-50 */
}

.checkbox-row:last-child {
    border-bottom: none;
}

.checkbox-label {
    flex: 1;
    color: #383532;
    font-size: 0.875rem;
}

.checkbox-value {
    font-weight: 600;
    font-size: 0.8rem;
    margin-right: 12px;
}

.checkbox-value.positive {
    color: #16a34a;
    /* Grün */
}

.checkbox-value.negative {
    color: #C3003A;
    /* IR Rot */
}

.checkbox-input {
    width: 20px;
    height: 20px;
    accent-color: #C3003A;
}


/* ============================================
   MIETZINS RESULT CARD
   ============================================ */

.mietzins-result-card {
    background: linear-gradient(135deg, #fdf2f4 0%, white 100%);
    border: 1px solid #eeede9;
    border-top: 4px solid #C3003A;
    padding: 20px;
}

.mietzins-result-value {
    font-size: 2rem;
    font-weight: 700;
    color: #383532;
}

.mietzins-result-row {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px solid #eeede9;
    font-size: 0.875rem;
}

.mietzins-result-row:last-child {
    border-bottom: none;
}

.mietzins-result-row.total {
    font-weight: 700;
    padding-top: 12px;
    margin-top: 8px;
    border-top: 2px solid #dddcd8;
    border-bottom: none;
}


/* ============================================
   TOGGLE SWITCH
   ============================================ */

.toggle-switch {
    position: relative;
    width: 48px;
    height: 28px;
    display: inline-block;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: absolute;
    cursor: pointer;
    inset: 0;
    background-color: #dddcd8;
    transition: background-color 0.2s;
}

.toggle-slider:before {
    content: "";
    position: absolute;
    height: 22px;
    width: 22px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: transform 0.2s;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.15);
}

.toggle-switch input:checked+.toggle-slider {
    background-color: #C3003A;
}

.toggle-switch input:checked+.toggle-slider:before {
    transform: translateX(20px);
}


/* ============================================
   FORM GROUPS
   ============================================ */

.form-group-mobile {
    margin-bottom: 16px;
}

.form-label-mobile {
    display: block;
    margin-bottom: 6px;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #736D64;
}


/* ============================================
   INFO BOXES
   ============================================ */

.info-box-warning {
    padding: 12px 16px;
    background: #fffbeb;
    border-left: 4px solid #f59e0b;
    margin-bottom: 16px;
}

.info-box-info {
    padding: 12px 16px;
    background: #f0f9ff;
    border-left: 4px solid #0284c7;
    margin-bottom: 16px;
}


/* ============================================
   SUB-TAB NAVIGATION (Richtwert-Rechner)
   ============================================ */

.sub-tab-nav {
    display: flex;
    border-bottom: 1px solid #eeede9;
    margin-bottom: 20px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.sub-tab-btn {
    padding: 12px 20px;
    background: transparent;
    border: none;
    border-bottom: 2px solid transparent;
    font-size: 0.875rem;
    font-weight: 500;
    color: #736D64;
    white-space: nowrap;
    cursor: pointer;
    transition: all 0.2s;
}

.sub-tab-btn:hover {
    color: #C3003A;
}

.sub-tab-btn.active {
    color: #C3003A;
    border-bottom-color: #C3003A;
    font-weight: 600;
}


/* ============================================
   UTILITY CLASSES
   ============================================ */

.text-ir-red {
    color: #C3003A !important;
}

.bg-ir-red {
    background-color: #C3003A !important;
}

.border-ir-red {
    border-color: #C3003A !important;
}

.fade-in {
    animation: fadeIn 0.3s ease-in;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}