/* Nebenkostenrechner Styles */

/* Themes */
:root {
    /* Standard Blau Theme */
    --primary: #4361ee;
    --primary-light: #4895ef;
    --secondary: #3f37c9;
    --accent: #4cc9f0;
    --text: #2b2d42;
    --text-light: #6c757d;
    --bg: #f8f9fa;
    --bg-card: #ffffff;
    --success: #06d6a0;
    --warning: #ffd166;
    --error: #ef476f;
    
    --shadow-sm: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-md: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --shadow-lg: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    
    --border-radius: 12px;
    --border-radius-lg: 20px;
    --border-radius-sm: 8px;
}

/* Dark Theme */
[data-theme="dark"] {
    --primary: #4361ee;
    --primary-light: #4895ef;
    --secondary: #560bad;
    --accent: #4cc9f0;
    --text: #f8f9fa;
    --text-light: #adb5bd;
    --bg: #121212;
    --bg-card: #1e1e1e;
    --success: #06d6a0;
    --warning: #ffd166;
    --error: #ef476f;
}

/* Nature Theme */
[data-theme="nature"] {
    --primary: #2D6A4F;
    --primary-light: #40916C;
    --secondary: #1B4332;
    --accent: #52B788;
    --text: #081C15;
    --text-light: #495057;
    --bg: #F1FAEE;
    --bg-card: #FFFFFF;
    --success: #57CC99;
    --warning: #FFD166;
    --error: #D62828;
}

/* Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', sans-serif;
}

body {
    background-color: var(--bg);
    color: var(--text);
    min-height: 100vh;
    transition: background-color 0.3s ease, color 0.3s ease;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 1rem;
}

/* Header Styles */
header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem 0;
    border-bottom: 1px solid rgba(0,0,0,0.1);
    margin-bottom: 2rem;
}

.logo {
    font-size: 1.5rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--primary);
}

.logo i {
    background: var(--primary);
    color: white;
    padding: 0.5rem;
    border-radius: var(--border-radius-sm);
}

.header-controls {
    display: flex;
    gap: 1rem;
    align-items: center;
}

/* Button Styles */
.btn {
    padding: 0.6rem 1.2rem;
    border-radius: var(--border-radius-sm);
    border: none;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    transition: all 0.2s ease;
    font-size: 0.9rem;
}

.btn i {
    font-size: 1rem;
}

.btn-primary {
    background-color: var(--primary);
    color: white;
}

.btn-primary:hover {
    background-color: var(--primary-light);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.btn-outline {
    background-color: transparent;
    border: 1px solid var(--primary);
    color: var(--primary);
}

.btn-outline:hover {
    background-color: var(--primary);
    color: white;
}

/* Theme Toggle */
.theme-toggle {
    background: none;
    border: none;
    color: var(--text);
    font-size: 1.2rem;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 50%;
    transition: background-color 0.2s ease;
}

.theme-toggle:hover {
    background-color: rgba(0,0,0,0.1);
}

/* Theme Dropdown */
.theme-dropdown {
    position: relative;
    display: inline-block;
}

.theme-dropdown-content {
    display: none;
    position: absolute;
    right: 0;
    background-color: var(--bg-card);
    min-width: 160px;
    box-shadow: var(--shadow-md);
    border-radius: var(--border-radius-sm);
    z-index: 1;
    padding: 0.5rem;
}

.theme-dropdown-content button {
    display: block;
    width: 100%;
    text-align: left;
    padding: 0.5rem 1rem;
    border: none;
    background: none;
    cursor: pointer;
    border-radius: var(--border-radius-sm);
    color: var(--text);
    transition: background-color 0.2s ease;
}

.theme-dropdown-content button:hover {
    background-color: rgba(0,0,0,0.05);
}

.theme-dropdown-content button.active {
    background-color: var(--primary);
    color: white;
}

.theme-dropdown:hover .theme-dropdown-content {
    display: block;
}

/* View Toggle */
.view-toggle {
    display: flex;
    background-color: var(--bg-card);
    border-radius: var(--border-radius-sm);
    padding: 0.25rem;
    box-shadow: var(--shadow-sm);
}

.view-toggle button {
    background: none;
    border: none;
    padding: 0.5rem 0.75rem;
    border-radius: var(--border-radius-sm);
    cursor: pointer;
    font-weight: 500;
    color: var(--text-light);
}

.view-toggle button.active {
    background-color: var(--primary);
    color: white;
}

/* Main Content */
.main-content {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2rem;
}

.section {
    background-color: var(--bg-card);
    border-radius: var(--border-radius);
    padding: 1.5rem;
    box-shadow: var(--shadow-sm);
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.section-title {
    font-size: 1.25rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.section-title i {
    color: var(--primary);
}

/* Years Container */
.years-container {
    display: grid;
    gap: 1.5rem;
    transition: all 0.3s ease;
}

.years-grid {
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
}

.years-list {
    grid-template-columns: 1fr;
}

/* Year Card */
.year-card {
    background-color: var(--bg-card);
    border-radius: var(--border-radius);
    padding: 1.5rem;
    box-shadow: var(--shadow-sm);
    border: 1px solid rgba(0,0,0,0.1);
    transition: all 0.2s ease;
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

.year-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-md);
    border-color: var(--primary-light);
}

.year-card .year {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 1rem;
    color: var(--primary);
}

.year-card .status {
    position: absolute;
    top: 1rem;
    right: 1rem;
    padding: 0.25rem 0.5rem;
    border-radius: var(--border-radius-sm);
    font-size: 0.75rem;
    font-weight: 600;
}

.year-card .status.completed {
    background-color: var(--success);
    color: white;
}

.year-card .status.pending {
    background-color: var(--warning);
    color: var(--text);
}

.year-card .status.new {
    background-color: var(--accent);
    color: white;
}

.cost-summary {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.5rem;
    margin-top: 1rem;
}

.cost-item {
    display: flex;
    justify-content: space-between;
    padding: 0.5rem 0;
    border-bottom: 1px dashed rgba(0,0,0,0.1);
}

.cost-item:last-child {
    border-bottom: none;
}

.cost-label {
    color: var(--text-light);
    font-size: 0.9rem;
}

.cost-value {
    font-weight: 600;
}

.year-card-list {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.year-card-list .year-info {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.year-card-list .year {
    margin-bottom: 0;
}

.year-card-list .cost-summary {
    display: flex;
    gap: 2rem;
    margin-top: 0;
}

.year-card-list .status {
    position: static;
}

/* Modal Styles */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0,0,0,0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.modal.active {
    opacity: 1;
    pointer-events: auto;
}

.modal-content {
    background-color: var(--bg-card);
    border-radius: var(--border-radius-lg);
    width: 90%;
    max-width: 900px;
    max-height: 90vh;
    overflow-y: auto;
    padding: 2rem;
    box-shadow: var(--shadow-lg);
    transform: translateY(20px);
    transition: transform 0.3s ease;
}

.modal.active .modal-content {
    transform: translateY(0);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid rgba(0,0,0,0.1);
}

.modal-title {
    font-size: 1.5rem;
    font-weight: 700;
}

.modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text-light);
    transition: color 0.2s ease;
}

.modal-close:hover {
    color: var(--error);
}

/* Tabs */
.tabs {
    display: flex;
    border-bottom: 1px solid rgba(0,0,0,0.1);
    margin-bottom: 1.5rem;
}

.tab {
    padding: 0.75rem 1.25rem;
    cursor: pointer;
    border-bottom: 2px solid transparent;
    font-weight: 600;
    color: var(--text-light);
    transition: all 0.2s ease;
}

.tab:hover {
    color: var(--primary);
}

.tab.active {
    border-bottom-color: var(--primary);
    color: var(--primary);
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

/* Form Styles */
.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.form-group {
    margin-bottom: 1rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: var(--text);
}

.form-control {
    width: 100%;
    padding: 0.75rem;
    border-radius: var(--border-radius-sm);
    border: 1px solid rgba(0,0,0,0.2);
    background-color: var(--bg-card);
    color: var(--text);
    font-size: 1rem;
    transition: border-color 0.2s ease;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(67, 97, 238, 0.3);
}

.form-group.total {
    grid-column: 1 / -1;
    padding: 1rem;
    background-color: rgba(67, 97, 238, 0.1);
    border-radius: var(--border-radius);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.form-group.total label {
    font-size: 1.1rem;
    margin-bottom: 0;
}

.form-group.total .form-control {
    width: auto;
    font-weight: 700;
    background-color: transparent;
    border: none;
    color: var(--primary);
    font-size: 1.2rem;
    text-align: right;
}

/* Chart Container */
.chart-container {
    margin-top: 2rem;
    height: 300px;
    position: relative;
}

/* Utility Tracking */
.utility-tracking {
    margin-top: 2rem;
}

.monthly-grid {
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    gap: 0.5rem;
    margin-top: 1rem;
    overflow-x: auto;
}

.month-cell {
    background-color: var(--bg-card);
    border: 1px solid rgba(0,0,0,0.1);
    border-radius: var(--border-radius-sm);
    padding: 0.75rem;
    text-align: center;
    min-width: 85px;
}

.month-header {
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--primary);
}

.month-data input {
    width: 100%;
    padding: 0.5rem;
    text-align: center;
    border-radius: var(--border-radius-sm);
    border: 1px solid rgba(0,0,0,0.1);
    margin-bottom: 0.25rem;
}

.month-data label {
    display: block;
    font-size: 0.7rem;
    color: var(--text-light);
    margin-bottom: 0.25rem;
}

/* Utility Settings */
.utility-settings {
    margin-top: 1rem;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1rem;
    padding: 1rem;
    background-color: rgba(0,0,0,0.03);
    border-radius: var(--border-radius);
}

.utility-settings .form-group {
    margin-bottom: 0;
}

/* Responsive Styles */
@media (max-width: 768px) {
    .form-grid {
        grid-template-columns: 1fr;
    }
    
    .monthly-grid {
        grid-template-columns: repeat(6, 1fr);
    }
    
    .year-card-list .cost-summary {
        display: none;
    }
}

/* Modern UI elements */
.glass-effect {
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.progress-bar-container {
    height: 6px;
    background-color: rgba(0,0,0,0.1);
    border-radius: 3px;
    overflow: hidden;
    margin-top: 0.5rem;
}

.progress-bar {
    height: 100%;
    background-color: var(--primary);
    border-radius: 3px;
    transition: width 0.3s ease;
}

.card-decoration {
    position: absolute;
    top: 0;
    right: 0;
    width: 100px;
    height: 100px;
    background: linear-gradient(135deg, var(--primary-light), var(--primary));
    opacity: 0.1;
    border-radius: 50%;
    transform: translate(30%, -30%);
    z-index: 0;
}

/* Badge Styles */
.badge {
    display: inline-block;
    padding: 0.25rem 0.5rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    margin-left: 0.5rem;
}

.badge-primary {
    background-color: var(--primary);
    color: white;
}

.badge-warning {
    background-color: var(--warning);
    color: var(--text);
}

.badge-success {
    background-color: var(--success);
    color: white;
}

/* Tooltip */
.tooltip {
    position: relative;
    display: inline-block;
}

.tooltip .tooltiptext {
    visibility: hidden;
    width: 200px;
    background-color: var(--bg-card);
    color: var(--text);
    text-align: center;
    border-radius: var(--border-radius-sm);
    padding: 0.5rem;
    position: absolute;
    z-index: 1;
    bottom: 125%;
    left: 50%;
    margin-left: -100px;
    opacity: 0;
    transition: opacity 0.3s;
    box-shadow: var(--shadow-md);
    border: 1px solid rgba(0,0,0,0.1);
    font-size: 0.8rem;
}

.tooltip:hover .tooltiptext {
    visibility: visible;
    opacity: 1;
}

/* Floating Button */
.floating-button {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background-color: var(--primary);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow-md);
    cursor: pointer;
    transition: all 0.2s ease;
    border: none;
    font-size: 1.5rem;
    z-index: 100;
}

.floating-button:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
    background-color: var(--primary-light);
}

/* Footer */
.footer {
    margin-top: 3rem;
    text-align: center;
    color: var(--text-light);
    font-size: 0.9rem;
    padding: 1rem 0;
    border-top: 1px solid rgba(0,0,0,0.1);
}

/* Animations */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.fade-in {
    animation: fadeIn 0.5s ease;
}

/* Export Styles */
.export-options {
    display: flex;
    gap: 1rem;
    margin-top: 1rem;
}

/* Scrollbar Styling */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: rgba(0,0,0,0.05);
    border-radius: 10px;
}

::-webkit-scrollbar-thumb {
    background: rgba(0,0,0,0.2);
    border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--primary-light);
}

/* Toast Meldungen */
.toast-container {
    position: fixed;
    top: 1rem;
    right: 1rem;
    z-index: 9999;
}

.toast {
    padding: 1rem;
    border-radius: var(--border-radius);
    margin-bottom: 0.5rem;
    box-shadow: var(--shadow-md);
    display: flex;
    align-items: center;
    justify-content: space-between;
    animation: slideIn 0.3s ease forwards;
    max-width: 300px;
}

.toast-success {
    background-color: var(--success);
    color: white;
}

.toast-error {
    background-color: var(--error);
    color: white;
}

.toast-warning {
    background-color: var(--warning);
    color: var(--text);
}

.toast-close {
    background: none;
    border: none;
    color: inherit;
    cursor: pointer;
    font-size: 1rem;
    opacity: 0.7;
    transition: opacity 0.2s ease;
}

.toast-close:hover {
    opacity: 1;
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.text-success {
    color: var(--success);
}

.text-danger {
    color: var(--error);
}

/* Nature Theme Specific Styles */
[data-theme="nature"] .card-decoration {
    background: linear-gradient(135deg, #74C69D, #2D6A4F);
}

[data-theme="nature"] .form-group.total {
    background-color: rgba(45, 106, 79, 0.1);
}

/* Section Divider */
.section-divider {
    display: flex;
    align-items: center;
    margin: 2rem 0;
}

.divider-line {
    flex: 1;
    height: 1px;
    background-color: rgba(0, 0, 0, 0.1);
}

.divider-title {
    padding: 0 1rem;
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--text-light);
}

/* Dark Theme Anpassung */
[data-theme="dark"] .divider-line {
    background-color: rgba(255, 255, 255, 0.1);
}

/* Status Selector Styles */
.status-selector {
    display: flex;
    gap: 1rem;
    align-items: center;
}

.status-selector select {
    max-width: 200px;
}

/* Animation für Status-Updates */
@keyframes statusSaved {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

.status-saved {
    animation: statusSaved 0.5s ease;
}

/* Status Badge auf Jahresdetails */
.year-status-badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
    margin-left: 1rem;
}

.year-status-badge.new {
    background-color: var(--accent);
    color: white;
}

.year-status-badge.pending {
    background-color: var(--warning);
    color: var(--text);
}

.year-status-badge.completed {
    background-color: var(--success);
    color: white;
}

/* Erweiterte Responsive Styles für die mobile Ansicht */
@media (max-width: 768px) {
    /* Bereits vorhandene Anpassungen */
    .form-grid {
        grid-template-columns: 1fr;
    }
    
    .monthly-grid {
        grid-template-columns: repeat(6, 1fr);
    }
    
    .year-card-list .cost-summary {
        display: none;
    }
    
    /* Neue Anpassungen */
    /* Header für mobile Geräte */
    header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.75rem;
    }
    
    .header-controls {
        width: 100%;
        justify-content: space-between;
    }
    
    /* Mobile Menü-Button (Hamburger) */
    .mobile-menu-toggle {
        display: block;
    }
    
    /* Modal auf volle Breite für Mobile */
    .modal-content {
        width: 100%;
        max-width: 100%;
        border-radius: 0;
        height: 100vh;
        max-height: 100vh;
        padding: 1rem;
    }
    
    /* Tabs für kleine Bildschirme optimieren */
    .tabs {
        display: flex;
        flex-wrap: wrap;
        gap: 0.25rem;
    }
    
    .tab {
        flex: 1 1 auto;
        text-align: center;
        padding: 0.5rem;
        font-size: 0.9rem;
    }
    
    /* Optimierte Verbrauchserfassung */
    .utility-tracking {
        overflow-x: hidden;
    }
    
    .month-selector {
        display: block;
        width: 100%;
        margin-bottom: 1rem;
    }
    
    .active-month-container {
        display: grid;
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    /* Angepasste Diagrammhöhe */
    .chart-container {
        height: 250px;
    }
}

/* Noch kleinere Bildschirme (Smartphones) */
@media (max-width: 480px) {
    .view-toggle button span {
        display: none; /* Text ausblenden, nur Icons anzeigen */
    }
    
    .year-card {
        padding: 1rem;
    }
    
    .utility-settings {
        grid-template-columns: 1fr;
    }
    
    /* Floating Button anpassen */
    .floating-button {
        width: 48px;
        height: 48px;
        right: 1rem;
        bottom: 1rem;
    }
}

/* Dropdown-Menü für Zählerstände */
.dropdown {
    position: relative;
    display: inline-block;
}

.dropdown-toggle {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    padding: 0.6rem 1rem;
    background-color: var(--bg-card);
    border-radius: var(--border-radius-sm);
    font-weight: 500;
    color: var(--text);
    border: 1px solid rgba(0,0,0,0.1);
}

.dropdown-toggle:hover {
    background-color: rgba(0,0,0,0.05);
}

.dropdown-menu {
    display: none;
    position: absolute;
    right: 0;
    background-color: var(--bg-card);
    min-width: 200px;
    box-shadow: var(--shadow-md);
    border-radius: var(--border-radius-sm);
    z-index: 100;
    padding: 0.5rem 0;
}

.dropdown:hover .dropdown-menu {
    display: block;
}

.dropdown-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    color: var(--text);
    text-decoration: none;
    transition: all 0.2s ease;
}

.dropdown-item:hover {
    background-color: rgba(0,0,0,0.05);
}

.dropdown-item.active {
    background-color: var(--primary);
    color: white;
}

.dropdown-item i {
    width: 20px;
    text-align: center;
}

/* Link-Buttons */
a.btn {
    display: inline-flex;
    align-items: center;
    text-decoration: none;
    gap: 0.5rem;
    font-weight: 600;
    transition: all 0.2s ease;
}

a.btn:hover {
    transform: translateY(-2px);
}

a.btn-outline {
    background-color: transparent;
    border: 1px solid var(--primary);
    color: var(--primary);
}

a.btn-outline:hover {
    background-color: var(--primary);
    color: white;
}

/* Responsive Design für mobile Geräte */
@media (max-width: 768px) {
    .dropdown-menu {
        position: absolute;
        left: 0;
        right: auto;
    }
}

/* Tarifinfo auf Karten */
.meter-card-tariff-info {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid rgba(0,0,0,0.1);
    font-size: 0.9rem;
}

.meter-card-provider, 
.meter-card-price {
    margin-bottom: 0.5rem;
    color: var(--text-light);
}

.meter-card-provider span,
.meter-card-price span {
    color: var(--text);
    font-weight: 500;
}