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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f5f5f5;
}

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

header {
    text-align: center;
    margin-bottom: 40px;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 15px;
}


.logout-btn {
    background: linear-gradient(135deg, #e74c3c 0%, #c0392b 100%);
    color: white;
    text-decoration: none;
    padding: 10px;
    border-radius: 8px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.logout-btn svg {
    width: 20px;
    height: 20px;
}

.logout-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(231, 76, 60, 0.3);
}

.header-logo {
    height: 60px;
    width: auto;
    opacity: 0.8;
    transition: opacity 0.3s ease;
}

.header-logo:hover {
    opacity: 1;
}

header h1 {
    color: #2c3e50;
    font-size: 2.5rem;
    margin-bottom: 10px;
    flex: 1;
}

/* Eingabebereich */
.eingabe-bereich {
    background: white;
    padding: 30px;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    margin-bottom: 30px;
}

.eingabe-bereich h2 {
    color: #34495e;
    margin-bottom: 20px;
    font-size: 1.5rem;
}

.objekt-form {
    display: flex;
    gap: 15px;
}

.objekt-input {
    flex: 1;
    padding: 12px 16px;
    border: 2px solid #ddd;
    border-radius: 6px;
    font-size: 16px;
    transition: border-color 0.3s ease;
}

.objekt-input:focus {
    outline: none;
    border-color: #3498db;
}

.submit-btn {
    padding: 12px 24px;
    background-color: #3498db;
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 16px;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.submit-btn:hover {
    background-color: #2980b9;
}

/* Toggle Form Button */
.toggle-form-btn {
    background-color: #27ae60;
    color: white;
    border: none;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    font-size: 18px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    margin: 0;
    position: absolute;
    top: 20px;
    left: 20px;
}

.toggle-form-btn:hover {
    background-color: #219a52;
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

/* Objektliste */
.objekt-liste {
    background: white;
    padding: 24px;
    border-radius: 12px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.08);
}

.objekt-liste h2 {
    color: #2c3e50;
    margin-bottom: 20px;
    font-size: 1.4rem;
    font-weight: 600;
}

.filter-controls {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 10px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.filter-controls label {
    font-weight: 600;
    color: #34495e;
}

.filter-select {
    padding: 8px 12px;
    border-radius: 6px;
    border: 1px solid #d0d7de;
    background-color: #fff;
    font-size: 14px;
    min-width: 220px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
    transition: border-color 0.2s ease;
}

.filter-select:focus {
    outline: none;
    border-color: #3498db;
}

/* Objekte Container - Responsive Grid */
.objekte-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 16px;
    align-items: start;
}

/* Performance Optimierungen */

/* Effiziente Animationen mit will-change */
.objekt-item {
    background: #ffffff;
    border: 1px solid #e1e8ed;
    border-radius: 12px;
    padding: 16px;
    transition: all 0.3s ease;
    position: relative;
    margin-bottom: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
    will-change: transform, box-shadow;
}

.objekt-item:hover {
    box-shadow: 0 4px 16px rgba(0,0,0,0.1);
    transform: translateY(-1px);
    border-color: #3498db;
}

/* Optimierte Button-Animationen */
.toggle-form-btn,
.submit-btn,
.logout-btn,
.login-btn {
    will-change: transform;
    backface-visibility: hidden;
    transform: translateZ(0);
}

/* Optimierte Eingabefelder */
.objekt-input,
.bemerkung-input,
.form-input {
    will-change: border-color;
}

/* GPU-beschleunigte Transformationen */
.edit-btn,
.save-btn,
.cancel-btn,
.delete-btn {
    transform: translateZ(0);
    backface-visibility: hidden;
}

/* Lazy Loading für Bilder */
.header-logo,
.login-logo {
    loading: lazy;
    image-rendering: optimizeQuality;
}

/* Optimierte Scrolling Performance */
.objekte-container {
    contain: layout style paint;
}

.objekt-item {
    contain: layout style;
}

/* Reduzierte Repaints */
.confirm-dialog {
    contain: layout style paint;
    transform: translateZ(0);
}

/* Optimierte Grid Performance */
@supports (display: grid) {
    .objekte-container {
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
        gap: 16px;
        align-items: start;
    }
}

/* Fallback für ältere Browser */
@supports not (display: grid) {
    .objekte-container {
        display: flex;
        flex-wrap: wrap;
        gap: 16px;
    }
    
    .objekt-item {
        flex: 1 1 300px;
        min-width: 300px;
    }
}

.objekt-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 12px;
    gap: 12px;
}

.objekt-name {
    font-size: 1rem;
    font-weight: 600;
    color: #2c3e50;
    line-height: 1.4;
    flex: 1;
    min-width: 0;
    word-wrap: break-word;
    margin: 0;
    padding: 0;
    display: flex;
    align-items: center;
    min-height: 24px;
}

.objekt-name-input {
    font-size: 1rem;
    font-weight: 600;
    color: #2c3e50;
    line-height: 1.4;
    flex: 1;
    min-width: 0;
    margin: 0;
    padding: 4px 8px;
    border: 2px solid transparent;
    border-radius: 6px;
    background-color: transparent;
    transition: all 0.2s ease;
    font-family: inherit;
}

.objekt-name-input:hover {
    border-color: #e1e8ed;
    background-color: #f8f9fa;
}

.objekt-name-input:focus {
    outline: none;
    border-color: #3498db;
    background-color: #ffffff;
    box-shadow: 0 0 0 2px rgba(52, 152, 219, 0.1);
}

/* Objektname Anzeige mit Edit-Button */
.objekt-name-display {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1;
    min-width: 0;
}

.objekt-name-text {
    font-size: 1rem;
    font-weight: 600;
    color: #2c3e50;
    line-height: 1.4;
    flex: 1;
    min-width: 0;
    word-wrap: break-word;
    margin: 0;
    padding: 0;
    cursor: pointer;
    transition: color 0.2s ease;
}

.objekt-name-text:hover {
    color: #3498db;
}

.edit-btn {
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    opacity: 0.4;
    transition: all 0.2s ease;
    font-size: 14px;
    color: #666;
}

.edit-btn:hover {
    opacity: 0.8;
    background-color: #f8f8f8;
    transform: scale(1.05);
}

.objekt-item:hover .edit-btn {
    opacity: 0.6;
}

/* Edit-Modus Layout */
.objekt-name-edit {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1;
    min-width: 0;
}

.objekt-name-input {
    flex: 1;
    min-width: 0;
    margin: 0;
}

.save-btn, .cancel-btn {
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px 6px;
    border-radius: 4px;
    font-size: 14px;
    transition: all 0.2s ease;
}

.save-btn {
    color: #27ae60;
}

.save-btn:hover {
    background-color: #e8f5e8;
    transform: scale(1.1);
}

.cancel-btn {
    color: #e74c3c;
}

.cancel-btn:hover {
    background-color: #fdedec;
    transform: scale(1.1);
}

.objekt-status {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
    margin: 0;
    padding: 0;
}

.status-checkbox {
    width: 20px;
    height: 20px;
    cursor: pointer;
    appearance: none;
    border: 2px solid #ddd;
    border-radius: 4px;
    position: relative;
    transition: all 0.2s ease;
    flex-shrink: 0;
    margin: 0;
    vertical-align: middle;
    z-index: 1;
}

.status-checkbox:hover {
    transform: scale(1.05);
    border-color: #999;
}

.status-checkbox:checked {
    background-color: #27ae60;
    border-color: #27ae60;
}

.status-checkbox:checked::after {
    content: '✓';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: white;
    font-size: 12px;
    font-weight: bold;
}

.status-label {
    font-size: 0.8rem;
    color: #666;
    white-space: nowrap;
    line-height: 1.4;
    display: flex;
    align-items: center;
    height: 20px;
    margin: 0;
}

.status-label.geprüft {
    color: #27ae60;
    font-weight: 600;
}

/* Bemerkungsfeld - Kompakter */
.bemerkung-container {
    margin-top: 12px;
    position: relative;
}

.bemerkung-label {
    display: block;
    font-size: 0.8rem;
    color: #666;
    margin-bottom: 4px;
    font-weight: 500;
}

.bemerkung-input {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #e1e8ed;
    border-radius: 6px;
    font-size: 13px;
    resize: vertical;
    min-height: 50px;
    transition: all 0.2s ease;
    background-color: #fafbfc;
}

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

.bemerkung-input:hover {
    border-color: #bdc3c7;
    background-color: #f8f9fa;
}

/* Lösch-Button - Unten rechts positioniert */
.delete-btn {
    position: absolute;
    bottom: 12px;
    left: 12px;
    background-color: #e74c3c;
    color: white;
    border: none;
    border-radius: 6px;
    width: 24px;
    height: 24px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0.7;
    padding: 0;
}

.delete-btn:hover {
    background-color: #c0392b;
    opacity: 1;
    transform: scale(1.1);
}

.objekt-item:hover .delete-btn {
    opacity: 0.9;
}

/* Bestätigungsdialog */
.confirm-dialog {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.confirm-content {
    background: white;
    padding: 30px;
    border-radius: 10px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    text-align: center;
    max-width: 400px;
    width: 90%;
}

.confirm-content h3 {
    color: #2c3e50;
    margin-bottom: 15px;
}

.confirm-content p {
    color: #666;
    margin-bottom: 25px;
}

.confirm-buttons {
    display: flex;
    gap: 15px;
    justify-content: center;
}

.confirm-btn {
    padding: 10px 20px;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.confirm-btn.yes {
    background-color: #e74c3c;
    color: white;
}

.confirm-btn.yes:hover {
    background-color: #c0392b;
}

.confirm-btn.no {
    background-color: #95a5a6;
    color: white;
}

.confirm-btn.no:hover {
    background-color: #7f8c8d;
}

.objekt-datum {
    font-size: 0.75rem;
    color: #95a5a6;
    margin-top: 8px;
    text-align: right;
    font-style: italic;
}

/* Leere Liste */
.leere-liste {
    text-align: center;
    padding: 40px;
    color: #999;
    font-style: italic;
}

/* Responsives Design - Mobile First Approach */

/* Basis-Styles für alle Geräte */
.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 16px;
}

/* Objekte Container - Responsive Grid */
.objekte-container {
    display: grid;
    grid-template-columns: 1fr;
    gap: 16px;
    align-items: start;
}

/* Small Mobile Devices (bis 480px) */
@media (max-width: 480px) {
    .container {
        padding: 12px;
    }
    
    .header-content {
        flex-direction: column;
        gap: 15px;
        text-align: center;
    }
    
    .header-right {
        order: -1;
        justify-content: center;
    }
    
    header h1 {
        font-size: 1.8rem;
        order: 1;
    }
    
    .toggle-form-btn {
        position: relative;
        top: auto;
        left: auto;
        margin-bottom: 20px;
        width: 100%;
        max-width: 200px;
        margin-left: auto;
        margin-right: auto;
        border-radius: 8px;
        height: 40px;
        font-size: 16px;
        display: block;
    }
    
    .eingabe-bereich,
    .objekt-liste {
        padding: 16px;
    }
    
    .objekt-form {
        flex-direction: column;
        gap: 12px;
    }
    
    .objekt-item {
        padding: 14px;
        margin-bottom: 10px;
    }
    
    .objekt-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
    
    .objekt-name {
        font-size: 0.95rem;
    }
    
    .objekt-status {
        align-self: flex-end;
        width: 100%;
        justify-content: flex-end;
    }
    
    .bemerkung-input {
        min-height: 45px;
        font-size: 12px;
    }
    
    .delete-btn {
        bottom: 10px;
        left: 10px;
        width: 22px;
        height: 22px;
        font-size: 12px;
    }
}

/* Mobile Devices (481px - 768px) */
@media (min-width: 481px) and (max-width: 768px) {
    .container {
        padding: 16px;
    }
    
    .header-content {
        flex-wrap: wrap;
        gap: 10px;
    }
    
    header h1 {
        font-size: 2.2rem;
        flex: 1;
        min-width: 250px;
    }
    
    .toggle-form-btn {
        position: relative;
        top: auto;
        left: auto;
        margin-bottom: 20px;
        width: auto;
        min-width: 100px;
        height: 40px;
        font-size: 16px;
    }
    
    .eingabe-bereich,
    .objekt-liste {
        padding: 20px;
    }
    
    .objekt-form {
        flex-direction: column;
        gap: 12px;
    }
    
    .objekte-container {
        grid-template-columns: 1fr;
        gap: 14px;
    }
    
    .objekt-header {
        flex-direction: row;
        align-items: center;
        gap: 12px;
    }
}

/* Tablets (769px - 1024px) */
@media (min-width: 769px) and (max-width: 1024px) {
    .container {
        padding: 20px;
        max-width: 900px;
    }
    
    header h1 {
        font-size: 2.5rem;
    }
    
    .objekte-container {
        grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
        gap: 16px;
    }
    
    .objekt-form {
        flex-direction: row;
        gap: 15px;
    }
    
    .eingabe-bereich,
    .objekt-liste {
        padding: 24px;
    }
}

/* Desktop (1025px - 1440px) */
@media (min-width: 1025px) and (max-width: 1440px) {
    .container {
        padding: 24px;
        max-width: 1000px;
    }
    
    .objekte-container {
        grid-template-columns: repeat(auto-fit, minmax(450px, 1fr));
        gap: 18px;
    }
    
    .eingabe-bereich,
    .objekt-liste {
        padding: 30px;
    }
}

/* Large Desktop (über 1440px) */
@media (min-width: 1441px) {
    .container {
        padding: 30px;
        max-width: 1200px;
    }
    
    .objekte-container {
        grid-template-columns: repeat(auto-fit, minmax(500px, 1fr));
        gap: 20px;
    }
    
    .eingabe-bereich,
    .objekt-liste {
        padding: 35px;
    }
    
    header h1 {
        font-size: 3rem;
    }
}

/* Landscape Orientation für Mobile */
@media (max-height: 500px) and (orientation: landscape) {
    .container {
        padding: 10px;
    }
    
    header {
        margin-bottom: 20px;
    }
    
    header h1 {
        font-size: 1.8rem;
    }
    
    .eingabe-bereich,
    .objekt-liste {
        padding: 15px;
    }
    
    .toggle-form-btn {
        width: 35px;
        height: 35px;
        font-size: 16px;
    }
}

/* High DPI Displays */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    .header-logo {
        image-rendering: -webkit-optimize-contrast;
        image-rendering: crisp-edges;
    }
}

/* Print Styles */
@media print {
    .toggle-form-btn,
    .logout-btn,
    .delete-btn,
    .edit-btn,
    .save-btn,
    .cancel-btn {
        display: none !important;
    }
    
    .container {
        max-width: none;
        padding: 0;
    }
    
    .objekt-item {
        break-inside: avoid;
        box-shadow: none;
        border: 1px solid #ccc;
    }
}
