/* Immobilien Rechner Plugin - Mobile First Responsive CSS */

/* Mobile First Design */
.immobilien-rechner-container {
    font-family: inherit;
    max-width: 100%;
    margin: 0 auto;
    padding: 10px;
    background: #f8f9fa;
    border-radius: 15px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.05);
}

.immobilien-rechner-container * {
    box-sizing: border-box;
}

.rechner-header {
    text-align: center;
    margin-bottom: 20px;
    padding: 20px 15px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 15px;
    color: white;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

.rechner-header h1 {
    font-size: 1.8em;
    margin-bottom: 8px;
    font-weight: 700;
    text-shadow: 0 2px 4px rgba(0,0,0,0.1);
    line-height: 1.2;
}

.rechner-header p {
    font-size: 0.95em;
    opacity: 0.9;
    font-weight: 300;
    line-height: 1.4;
}

.rechner-tabs {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    margin-bottom: 20px;
    gap: 8px;
    padding: 0 5px;
}

.tab-button {
    padding: 12px 20px;
    border: none;
    border-radius: 12px;
    font-size: 1em;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    background: white;
    color: #7f8c8d;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    position: relative;
    overflow: hidden;
    width: 100%;
    text-align: center;
    touch-action: manipulation;
    min-height: 48px;
}

.tab-button::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.4), transparent);
    transition: left 0.5s;
}

.tab-button:hover::before {
    left: 100%;
}

.tab-button.active {
    background: linear-gradient(135deg, #3498db, #2980b9);
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(52, 152, 219, 0.4);
}

.tab-button:hover:not(.active) {
    background: #ecf0f1;
    transform: translateY(-1px);
    box-shadow: 0 4px 15px rgba(0,0,0,0.15);
}

.rechner-content {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.eingabe-bereich,
.ergebnis-bereich {
    width: 100%;
}

.card {
    background: white;
    border-radius: 15px;
    padding: 20px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.08);
    margin-bottom: 15px;
    transition: all 0.3s ease;
    border: 1px solid rgba(0,0,0,0.05);
    position: relative;
    overflow: hidden;
}

.card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, #3498db, #9b59b6, #e74c3c, #f39c12, #27ae60);
    opacity: 0;
    transition: opacity 0.3s ease;
}

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

.card:hover::before {
    opacity: 1;
}

.card h3 {
    color: #2c3e50;
    margin-bottom: 15px;
    font-size: 1.2em;
    font-weight: 600;
    padding-bottom: 8px;
    border-bottom: 2px solid #ecf0f1;
    position: relative;
}

.card h3::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 30px;
    height: 2px;
    background: linear-gradient(90deg, #3498db, #9b59b6);
}

.input-group {
    position: relative;
    margin-bottom: 20px;
}

.input-group label {
    display: block;
    margin-bottom: 6px;
    color: #34495e;
    font-weight: 500;
    font-size: 0.9em;
}

.input-group input {
    width: 100%;
    padding: 14px 50px 14px 14px;
    border: 2px solid #ecf0f1;
    border-radius: 12px;
    font-size: 16px; /* Prevents zoom on iOS */
    font-weight: 500;
    transition: all 0.3s ease;
    background: #fafafa;
    -webkit-appearance: none;
    -moz-appearance: textfield;
    touch-action: manipulation;
}

.input-group input:focus {
    outline: none;
    border-color: #3498db;
    background: white;
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
    border-width: 3px;
}

.input-group input:hover {
    border-color: #bdc3c7;
    background: white;
}

.input-suffix {
    position: absolute;
    right: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: #7f8c8d;
    font-weight: 600;
    margin-top: 12px;
    background: #ecf0f1;
    padding: 3px 6px;
    border-radius: 4px;
    font-size: 0.8em;
}

.ergebnis-zeile {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 12px 0;
    border-bottom: 1px solid #ecf0f1;
    transition: background-color 0.2s ease;
    flex-wrap: wrap;
    gap: 5px;
    font-size: 0.9em;
}

.ergebnis-zeile > span:first-child {
    flex: 1;
    min-width: 50%;
    line-height: 1.3;
}

.ergebnis-zeile > span:last-child {
    text-align: right;
    flex-shrink: 0;
}

.ergebnis-zeile:hover {
    background-color: rgba(52, 152, 219, 0.02);
    margin: 0 -20px;
    padding: 12px 20px;
    border-radius: 8px;
}

.ergebnis-zeile:last-child {
    border-bottom: none;
}

.ergebnis-zeile.highlight {
    background: linear-gradient(135deg, #f8f9fa, #e3f2fd);
    margin: 10px -20px;
    padding: 20px;
    border-radius: 12px;
    border: 2px solid #3498db;
    position: relative;
    overflow: hidden;
}

.ergebnis-zeile.highlight::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(52, 152, 219, 0.1), transparent);
    animation: shimmer 2s infinite;
}

@keyframes shimmer {
    0% { left: -100%; }
    100% { left: 100%; }
}

.wert {
    font-weight: 700;
    color: #2c3e50;
    font-family: 'Courier New', monospace;
    font-size: 0.9em;
    font-weight: 800;
}

.wert.gross {
    font-size: 1.1em;
    color: #3498db;
    text-shadow: 0 1px 2px rgba(52, 152, 219, 0.2);
}

.wert.positiv {
    color: #27ae60;
}

.wert.negativ {
    color: #e74c3c;
}

.bewertung {
    margin-top: 20px;
    padding: 12px;
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    text-align: center;
}

.bewertung::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 4px;
    transition: width 0.3s ease;
}

.bewertung:hover::before {
    width: 8px;
}

.bewertung.gut {
    background: linear-gradient(135deg, #d5f4e6, #a8e6cf);
    color: #27ae60;
}

.bewertung.gut::before {
    background: #27ae60;
}

.bewertung.mittel {
    background: linear-gradient(135deg, #fef9e7, #ffd93d);
    color: #f39c12;
}

.bewertung.mittel::before {
    background: #f39c12;
}

.bewertung.schlecht {
    background: linear-gradient(135deg, #fadbd8, #ffb3ba);
    color: #e74c3c;
}

.bewertung.schlecht::before {
    background: #e74c3c;
}

.bewertung.neutral {
    background: linear-gradient(135deg, #eaf2f8, #bae1ff);
    color: #3498db;
}

.bewertung.neutral::before {
    background: #3498db;
}

.bewertung-icon {
    font-size: 2em;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.1));
}

.bewertung-text {
    line-height: 1.3;
    font-size: 0.9em;
}

.bewertung-text strong {
    display: block;
    font-size: 1em;
    margin-bottom: 5px;
}

.chart-container {
    height: 180px;
    position: relative;
    background: #fafafa;
    border-radius: 8px;
    padding: 10px;
}

.tipp {
    margin-bottom: 12px;
    padding: 12px;
    background: linear-gradient(135deg, #f8f9fa, #e9ecef);
    border-radius: 10px;
    border-left: 4px solid #3498db;
    transition: all 0.3s ease;
    position: relative;
    font-size: 0.85em;
    line-height: 1.3;
}

.tipp:hover {
    transform: translateX(5px);
    box-shadow: 0 4px 15px rgba(52, 152, 219, 0.2);
    border-left-width: 6px;
}

.tipp:last-child {
    margin-bottom: 0;
}

.tipp strong {
    color: #2c3e50;
    display: block;
    margin-bottom: 5px;
}

/* Save Calculation Styles - ENTFERNT */
/* .save-calculation, .save-btn, .save-message styles entfernt */

/* Loading Animation */
.loading {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid #3498db;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-right: 8px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Error Styling */
.input-group input.error {
    border-color: #e74c3c !important;
    box-shadow: 0 0 0 3px rgba(231, 76, 60, 0.1) !important;
}

.input-tooltip {
    position: absolute;
    bottom: -30px;
    left: 0;
    background: #e74c3c;
    color: white;
    padding: 5px 10px;
    border-radius: 4px;
    font-size: 12px;
    z-index: 1000;
}

.input-tooltip::before {
    content: '';
    position: absolute;
    top: -5px;
    left: 15px;
    width: 0;
    height: 0;
    border-left: 5px solid transparent;
    border-right: 5px solid transparent;
    border-bottom: 5px solid #e74c3c;
}

.calculation-error {
    background: #fadbd8;
    color: #e74c3c;
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 20px;
    border-left: 4px solid #e74c3c;
    animation: slideDown 0.3s ease-out;
}

@keyframes slideDown {
    from {
        opacity: 0;
        max-height: 0;
        padding-top: 0;
        padding-bottom: 0;
    }
    to {
        opacity: 1;
        max-height: 100px;
        padding-top: 15px;
        padding-bottom: 15px;
    }
}

/* Swipe Feedback */
.swipe-feedback {
    animation: swipeGlow 0.3s ease-out !important;
}

@keyframes swipeGlow {
    0% { box-shadow: 0 0 0 0 rgba(52, 152, 219, 0.7); }
    70% { box-shadow: 0 0 0 10px rgba(52, 152, 219, 0); }
    100% { box-shadow: 0 0 0 0 rgba(52, 152, 219, 0); }
}

@keyframes fadeInOut {
    0%, 100% { opacity: 0; transform: translateX(-50%) translateY(20px); }
    10%, 90% { opacity: 1; transform: translateX(-50%) translateY(0); }
}

/* Animation Classes */
.fade-in {
    animation: fadeIn 0.5s ease-out;
}

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

.slide-in-left {
    animation: slideInLeft 0.5s ease-out;
}

@keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translateX(-30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.slide-in-right {
    animation: slideInRight 0.5s ease-out;
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Tablet Styles (768px and up) */
@media (min-width: 768px) {
    .immobilien-rechner-container {
        max-width: 1200px;
        padding: 20px;
    }
    
    .rechner-header {
        padding: 25px 20px;
        margin-bottom: 25px;
    }
    
    .rechner-header h1 {
        font-size: 2.2em;
        margin-bottom: 10px;
    }
    
    .rechner-header p {
        font-size: 1.05em;
    }
    
    .rechner-tabs {
        flex-direction: row;
        justify-content: center;
        gap: 10px;
        margin-bottom: 25px;
        padding: 0;
    }
    
    .tab-button {
        padding: 14px 25px;
        font-size: 1.05em;
        width: auto;
        min-width: 200px;
    }
    
    .rechner-content {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 25px;
        align-items: start;
    }
    
    .card {
        padding: 22px;
        margin-bottom: 18px;
    }
    
    .card h3 {
        font-size: 1.25em;
        margin-bottom: 18px;
        padding-bottom: 10px;
    }
    
    .input-group label {
        color: #b0b0b0;
    }
    
    .input-group input {
        background: #404040;
        border-color: #555;
        color: #e0e0e0;
    }
    
    .input-group input:focus {
        background: #4a4a4a;
        border-color: #3498db;
    }
    
    .input-suffix {
        background: #555;
        color: #b0b0b0;
    }
    
    .ergebnis-zeile {
        border-bottom-color: #404040;
    }
    
    .wert {
        color: #e0e0e0;
    }
    
    .tipp {
        background: linear-gradient(135deg, #2d2d2d, #404040);
        color: #e0e0e0;
    }
    
    .chart-container {
        background: #404040;
    }
}

/* High contrast mode */
@media (prefers-contrast: high) {
    .card {
        border: 2px solid #000;
    }
    
    .input-group input {
        border: 2px solid #000;
    }
    
    .bewertung {
        border: 2px solid currentColor;
    }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Print Styles */
@media print {
    .immobilien-rechner-container {
        background: white;
        box-shadow: none;
        max-width: none;
    }
    
    .rechner-tabs,
    .save-calculation {
        display: none;
    }
    
    .card {
        box-shadow: none;
        border: 1px solid #ddd;
        break-inside: avoid;
    }
    
    .chart-container {
        background: white;
    }
}

/* Focus styles for accessibility */
.tab-button:focus,
.input-group input:focus,
.save-btn:focus {
    outline: 2px solid #3498db;
    outline-offset: 2px;
}

/* Remove number input arrows */
.input-group input::-webkit-outer-spin-button,
.input-group input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.input-group input[type=number] {
    -moz-appearance: textfield;
} {
        margin-bottom: 22px;
    }
    
    .input-group input {
        padding: 15px 55px 15px 15px;
        font-size: 1.05em;
    }
    
    .input-suffix {
        right: 15px;
        font-size: 0.85em;
        padding: 4px 7px;
    }
    
    .ergebnis-zeile {
        padding: 15px 0;
        align-items: center;
        flex-wrap: nowrap;
        font-size: 1em;
    }
    
    .ergebnis-zeile > span:first-child {
        min-width: auto;
    }
    
    .ergebnis-zeile.highlight {
        padding: 22px;
        margin: 10px -22px;
    }
    
    .wert {
        font-size: 1em;
    }
    
    .wert.gross {
        font-size: 1.3em;
    }
    
    .bewertung {
        flex-direction: row;
        text-align: left;
        padding: 18px;
        gap: 15px;
        margin-top: 22px;
    }
    
    .bewertung-text {
        flex: 1;
        font-size: 1em;
    }
    
    .bewertung-text strong {
        font-size: 1.05em;
    }
    
    .chart-container {
        height: 220px;
    }
    
    .tipp {
        padding: 16px;
        margin-bottom: 15px;
        font-size: 0.95em;
    }
    
    .save-btn {
        font-size: 1em;
        padding: 12px 24px;
        width: auto;
    }
}

/* Desktop Styles (1024px and up) */
@media (min-width: 1024px) {
    .rechner-header h1 {
        font-size: 2.5em;
    }
    
    .rechner-header p {
        font-size: 1.1em;
    }
    
    .rechner-content {
        gap: 30px;
    }
    
    .card {
        padding: 25px;
        margin-bottom: 20px;
    }
    
    .card h3 {
        font-size: 1.3em;
        margin-bottom: 20px;
        padding-bottom: 12px;
    }
    
    .input-group {
        margin-bottom: 25px;
    }
    
    .input-group input {
        padding: 16px 60px 16px 16px;
        font-size: 1.1em;
    }
    
    .input-suffix {
        font-size: 0.9em;
        padding: 4px 8px;
    }
    
    .ergebnis-zeile {
        padding: 18px 0;
    }
    
    .ergebnis-zeile.highlight {
        padding: 25px;
        margin: 10px -25px;
    }
    
    .wert.gross {
        font-size: 1.4em;
    }
    
    .bewertung {
        padding: 20px;
        margin-top: 25px;
    }
    
    .bewertung-icon {
        font-size: 2.5em;
    }
    
    .bewertung-text strong {
        font-size: 1.1em;
    }
    
    .chart-container {
        height: 250px;
    }
    
    .tipp {
        padding: 18px;
        font-size: 1em;
    }
}

/* Large Desktop (1200px and up) */
@media (min-width: 1200px) {
    .rechner-content {
        gap: 35px;
    }
    
    .card:hover {
        transform: translateY(-3px);
    }
}

/* Extra small devices (480px and down) */
@media (max-width: 480px) {
    .immobilien-rechner-container {
        padding: 8px;
    }
    
    .card {
        padding: 15px;
    }
    
    .rechner-header {
        padding: 15px 10px;
    }
    
    .rechner-header h1 {
        font-size: 1.6em;
    }
    
    .input-group input {
        padding: 12px 45px 12px 12px;
        font-size: 16px; /* Prevent zoom */
    }
    
    .input-suffix {
        right: 12px;
        font-size: 0.75em;
    }
    
    .ergebnis-zeile {
        padding: 10px 0;
        font-size: 0.85em;
    }
    
    .chart-container {
        height: 180px;
    }
}

/* Dark Mode Support */
@media (prefers-color-scheme: dark) {
    .immobilien-rechner-container {
        background: #1a1a1a;
        color: #e0e0e0;
    }
    
    .card {
        background: #2d2d2d;
        border-color: rgba(255,255,255,0.1);
    }
    
    .card h3 {
        color: #e0e0e0;
        border-bottom-color: #404040;
    }
    
    .input-group