* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary: #2563eb;
    --primary-dark: #1e40af;
    --secondary: #10b981;
    --danger: #ef4444;
    --bg-primary: #f8fafc;
    --bg-card: #ffffff;
    --text-primary: #1e293b;
    --text-secondary: #64748b;
    --border: #e2e8f0;
    --shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 25px -5px rgba(0, 0, 0, 0.1);
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -webkit-tap-highlight-color: transparent;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

header {
    text-align: center;
    margin-bottom: 30px;
    padding: 30px 20px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    border-radius: 15px;
    color: white;
    box-shadow: var(--shadow-lg);
}

header h1 {
    font-size: 2rem;
    margin-bottom: 10px;
}

.date-display {
    font-size: 1.1rem;
    opacity: 0.9;
}

/* Aktuelle Werte Cards */
.current-values {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.value-card {
    background: var(--bg-card);
    border-radius: 12px;
    padding: 25px;
    box-shadow: var(--shadow);
    display: flex;
    align-items: center;
    gap: 20px;
    transition: transform 0.2s, box-shadow 0.2s;
    cursor: pointer;
    position: relative;
}

.value-card::after {
    content: 'ℹ️';
    position: absolute;
    top: 10px;
    right: 10px;
    font-size: 1.2rem;
    opacity: 0.5;
    transition: opacity 0.2s;
}

.value-card:hover {
    box-shadow: var(--shadow-lg);
}

.value-card:hover::after {
    opacity: 1;
}

.value-card:active {
    transform: scale(0.98);
}

.value-card.household {
    border-left: 4px solid var(--primary);
}

.value-card.heatpump {
    border-left: 4px solid #f59e0b;
}

.value-card.temperature {
    border-left: 4px solid #10b981;
}

.value-card.water {
    border-left: 4px solid #06b6d4;
}

.card-icon {
    font-size: 3rem;
    line-height: 1;
}

.card-content {
    flex: 1;
}

.card-content h3 {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.current-reading {
    font-size: 2rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 5px;
}

.last-update {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

/* Eingabebereich */
.input-section {
    background: var(--bg-card);
    border-radius: 12px;
    padding: 25px;
    box-shadow: var(--shadow);
    margin-bottom: 30px;
}

.input-section h2 {
    font-size: 1.5rem;
    margin-bottom: 20px;
    color: var(--text-primary);
}

.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    margin-bottom: 15px;
}

.form-group {
    display: flex;
    flex-direction: column;
}

.form-group label {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.form-group input,
.form-group select {
    padding: 12px 15px;
    border: 2px solid var(--border);
    border-radius: 8px;
    font-size: 1rem;
    transition: border-color 0.2s;
    background: white;
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--primary);
}

.btn-primary {
    width: 100%;
    padding: 15px;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s, transform 0.1s;
    margin-top: 10px;
}

.btn-primary:active {
    transform: scale(0.98);
    background: var(--primary-dark);
}

/* Statistiken */
.stats-section {
    background: var(--bg-card);
    border-radius: 12px;
    padding: 25px;
    box-shadow: var(--shadow);
    margin-bottom: 30px;
}

.tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    border-bottom: 2px solid var(--border);
    overflow-x: auto;
}

.tab {
    padding: 12px 24px;
    background: none;
    border: none;
    border-bottom: 3px solid transparent;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 500;
    color: var(--text-secondary);
    transition: all 0.2s;
    white-space: nowrap;
}

.tab.active {
    color: var(--primary);
    border-bottom-color: var(--primary);
}

.chart-container {
    position: relative;
    height: 300px;
    margin-bottom: 20px;
}

.daily-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    margin-top: 20px;
}

.stat-item {
    display: flex;
    justify-content: space-between;
    padding: 15px;
    background: var(--bg-primary);
    border-radius: 8px;
}

.stat-label {
    font-weight: 500;
    color: var(--text-secondary);
}

.stat-value {
    font-weight: 700;
    color: var(--primary);
    font-size: 1.1rem;
}

/* Historie */
.history-section {
    background: var(--bg-card);
    border-radius: 12px;
    padding: 25px;
    box-shadow: var(--shadow);
}

.history-section h2 {
    font-size: 1.5rem;
    margin-bottom: 20px;
}

.history-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-height: 480px;
    overflow-y: auto;
    padding-right: 5px;
}

.history-list::-webkit-scrollbar {
    width: 8px;
}

.history-list::-webkit-scrollbar-track {
    background: var(--bg-primary);
    border-radius: 4px;
}

.history-list::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 4px;
}

.history-list::-webkit-scrollbar-thumb:hover {
    background: var(--text-secondary);
}

.history-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px;
    background: var(--bg-primary);
    border-radius: 8px;
    transition: background 0.2s;
}

.history-item:active {
    background: var(--border);
}

.history-info {
    flex: 1;
}

.history-type {
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.history-type.household {
    color: var(--primary);
}

.history-type.heatpump {
    color: #f59e0b;
}

.history-type.temperature {
    color: #10b981;
}

.history-type.water {
    color: #06b6d4;
}

.history-date {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.history-value {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--text-primary);
}

.loading {
    text-align: center;
    padding: 40px;
    color: var(--text-secondary);
}

/* Notification */
.notification {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 15px 25px;
    background: var(--secondary);
    color: white;
    border-radius: 8px;
    box-shadow: var(--shadow-lg);
    transform: translateX(400px);
    transition: transform 0.3s;
    z-index: 1000;
    font-weight: 500;
}

.notification.show {
    transform: translateX(0);
}

.notification.error {
    background: var(--danger);
}

/* Montags-Reminder */
.monday-reminder {
    position: fixed;
    top: 100px;
    left: 50%;
    transform: translateX(-50%) translateY(-100%);
    display: none;
    width: 90%;
    max-width: 500px;
    background: linear-gradient(135deg, #06b6d4 0%, #0891b2 100%);
    color: white;
    border-radius: 12px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
    z-index: 2000;
    transition: transform 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    overflow: hidden;
}

.monday-reminder.show {
    display: block;
    transform: translateX(-50%) translateY(0);
}

.reminder-content {
    display: flex;
    align-items: center;
    padding: 20px;
    gap: 15px;
}

.reminder-icon {
    font-size: 2.5rem;
    line-height: 1;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

.reminder-text {
    flex: 1;
}

.reminder-text strong {
    display: block;
    font-size: 1.1rem;
    margin-bottom: 5px;
}

.reminder-text p {
    margin: 0;
    font-size: 0.9rem;
    opacity: 0.95;
}

.reminder-close {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    font-size: 2rem;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
    line-height: 1;
    padding: 0;
}

.reminder-close:active {
    background: rgba(255, 255, 255, 0.3);
}

/* Info Modal */
.info-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 3000;
    display: none;
    align-items: center;
    justify-content: center;
}

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

.modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
}

.modal-content {
    position: relative;
    background: var(--bg-card);
    border-radius: 16px;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.3);
    width: 90%;
    max-width: 500px;
    max-height: 80vh;
    overflow: auto;
    animation: modalSlideIn 0.3s ease-out;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-50px) scale(0.9);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.modal-close {
    position: absolute;
    top: 15px;
    right: 15px;
    background: var(--bg-primary);
    border: none;
    color: var(--text-secondary);
    font-size: 2rem;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    line-height: 1;
    padding: 0;
    z-index: 1;
}

.modal-close:hover {
    background: var(--border);
    color: var(--text-primary);
}

.modal-close:active {
    transform: scale(0.95);
}

.modal-header {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 30px 30px 20px 30px;
    border-bottom: 2px solid var(--border);
}

.modal-icon {
    font-size: 2.5rem;
    line-height: 1;
}

.modal-header h2 {
    margin: 0;
    font-size: 1.5rem;
    color: var(--text-primary);
}

.modal-body {
    padding: 30px;
}

.info-item {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 20px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--border);
}

.info-item:last-child {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
}

.info-label {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.info-value {
    font-size: 1.1rem;
    color: var(--text-primary);
    font-weight: 500;
    word-break: break-word;
}

/* Tablet Optimierungen */
@media (min-width: 768px) {
    .container {
        padding: 30px;
    }
    
    header h1 {
        font-size: 2.5rem;
    }
    
    .current-reading {
        font-size: 2.5rem;
    }
}

/* Touch-Optimierungen */
@media (hover: none) {
    .btn-primary:hover {
        background: var(--primary);
    }
}
