/* Reset und Grundstile */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* Dark Mode Toggle */
.dark-mode-toggle {
    position: fixed;
    top: 20px;
    left: 20px;
    z-index: 1000;
    background: rgba(255, 255, 255, 0.9);
    border: none;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.dark-mode-toggle:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.25);
}

/* CSS Variables für Theme-Switching */
:root {
    --bg-primary: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --bg-secondary: white;
    --text-primary: #333;
    --text-secondary: #6b7280;
    --border-color: #e5e7eb;
    --shadow-color: rgba(0, 0, 0, 0.1);
    --input-bg: #fafafa;
    --section-bg: white;
    --header-bg: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

[data-theme="dark"] {
    --bg-primary: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    --bg-secondary: #1e293b;
    --text-primary: #f1f5f9;
    --text-secondary: #94a3b8;
    --border-color: #334155;
    --shadow-color: rgba(0, 0, 0, 0.3);
    --input-bg: #334155;
    --section-bg: #1e293b;
    --header-bg: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: var(--bg-primary, linear-gradient(135deg, #667eea 0%, #764ba2 100%));
    min-height: 100vh;
    padding: 1rem;
    color: var(--text-primary, #333);
    transition: all 0.3s ease;
}

/* Container */
.container {
    max-width: 1200px;
    margin: 0 auto;
    background: var(--bg-secondary, white);
    border-radius: 1rem;
    box-shadow: 0 25px 50px -12px var(--shadow-color, rgba(0, 0, 0, 0.25));
    overflow: hidden;
    backdrop-filter: blur(10px);
    border: 1px solid var(--border-color, rgba(255, 255, 255, 0.2));
    transition: all 0.3s ease;
}

/* Header */
.header {
    background: var(--header-bg, linear-gradient(135deg, #667eea 0%, #764ba2 100%));
    color: white;
    padding: 2rem;
    position: relative;
    box-shadow: 0 4px 6px -1px var(--shadow-color, rgba(0, 0, 0, 0.1));
    transition: all 0.3s ease;
}



.header-logo-container {
    position: absolute;
    top: 1.5rem;
    right: 1.5rem;
    z-index: 10;
}

.header-logo {
    height: 90px;
    max-width: 200px;
    object-fit: contain;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
    margin-top: 80px;
}

.header-title {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.header-title h1 {
    font-size: 1.5rem;
    font-weight: bold;
}

.header-title p {
    color: #6b7280;
    margin-top: 0.25rem;
}

.header-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

/* Buttons */
.btn {
    padding: 0.75rem 1.25rem;
    border: none;
    border-radius: 0.75rem;
    cursor: pointer;
    font-size: 0.875rem;
    font-weight: 600;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: white;
    text-decoration: none;
    position: relative;
    overflow: hidden;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

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

.btn:hover::before {
    left: 100%;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
    filter: brightness(1.1);
}

.btn-text {
    display: inline-block;
}

.btn-primary { background: linear-gradient(135deg, #667eea 0%, #764ba2 100%); }
.btn-primary:hover { background: linear-gradient(135deg, #5a67d8 0%, #6b46c1 100%); }
.btn-purple { background: linear-gradient(135deg, #8b5cf6 0%, #7c3aed 100%); }
.btn-purple:hover { background: linear-gradient(135deg, #7c3aed 0%, #6d28d9 100%); }
.btn-indigo { background: linear-gradient(135deg, #6366f1 0%, #4f46e5 100%); }
.btn-indigo:hover { background: linear-gradient(135deg, #4f46e5 0%, #4338ca 100%); }
.btn-orange { background: linear-gradient(135deg, #f97316 0%, #ea580c 100%); }
.btn-orange:hover { background: linear-gradient(135deg, #ea580c 0%, #c2410c 100%); }
.btn-green { background: linear-gradient(135deg, #22c55e 0%, #16a34a 100%); }
.btn-green:hover { background: linear-gradient(135deg, #16a34a 0%, #15803d 100%); }
.btn-red { background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%); }
.btn-red:hover { background: linear-gradient(135deg, #dc2626 0%, #b91c1c 100%); }
.btn-admin { 
    background: linear-gradient(135deg, #dc2626 0%, #b91c1c 100%); 
    position: relative;
    overflow: hidden;
}

.btn-admin::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    transition: left 0.6s;
}

.btn-admin:hover::after {
    left: 100%;
}

.btn-admin:hover { 
    background: linear-gradient(135deg, #b91c1c 0%, #991b1b 100%); 
    transform: translateY(-3px);
    box-shadow: 0 15px 35px rgba(220, 38, 38, 0.4);
}

.admin-access {
    position: relative;
}

.admin-access::before {
    content: '⚡';
    position: absolute;
    top: -8px;
    right: -8px;
    font-size: 12px;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% { opacity: 1; }
    50% { opacity: 0.5; }
    100% { opacity: 1; }
}
.btn-blue {
    background: linear-gradient(135deg, #3b82f6, #1d4ed8);
    color: white;
    border: 1px solid #2563eb;
}

.btn-blue:hover {
    background: linear-gradient(135deg, #2563eb, #1e40af);
    border-color: #1d4ed8;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
}

.btn-small {
    padding: 0.25rem 0.75rem;
    font-size: 0.75rem;
}

.icon {
    width: 1rem;
    height: 1rem;
}

/* Content */
.content {
    padding: 1.5rem;
}

/* Sections */
.section {
    margin-bottom: 2rem;
    padding: 2rem;
    background: var(--section-bg, white);
    border-radius: 1rem;
    box-shadow: 0 4px 6px -1px var(--shadow-color, rgba(0, 0, 0, 0.1));
    border: 1px solid var(--border-color, rgba(0, 0, 0, 0.05));
    transition: all 0.3s ease;
}

.section:hover {
    box-shadow: 0 10px 25px -3px rgba(0, 0, 0, 0.1);
    transform: translateY(-1px);
}

.section-title {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--text-primary, #374151);
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.section-bg {
    background: #f9fafb;
    padding: 1.5rem;
    border-radius: 0.5rem;
}

.section-bg-blue {
    background: #eff6ff;
    padding: 1.5rem;
    border-radius: 0.5rem;
}

/* Form Grids */
.form-grid {
    display: grid;
    gap: 1.5rem;
}

.form-grid-2 {
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
}

.form-grid-4 {
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
}

.form-grid-6 {
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
}

/* Form Elements */
.form-group {
    margin-bottom: 1rem;
}

.form-label {
    display: block;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-primary, #374151);
    margin-bottom: 0.25rem;
}

.form-input {
    width: 100%;
    padding: 1rem;
    border: 2px solid var(--border-color, #e5e7eb);
    border-radius: 0.75rem;
    font-size: 1rem;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    background: var(--input-bg, #fafafa);
    font-family: inherit;
    color: var(--text-primary, #333);
}

.form-input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 4px rgba(102, 126, 234, 0.1);
    background: var(--bg-secondary, white);
    transform: translateY(-1px);
}

.form-input:hover {
    border-color: #9ca3af;
    background: var(--bg-secondary, white);
}

.form-input:read-only {
    background: var(--input-bg, #f9fafb);
    opacity: 0.7;
}

.textarea {
    resize: vertical;
    min-height: 100px;
}

/* Radio Groups */
.radio-group {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 1rem;
    padding: 1.5rem;
    background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
    border-radius: 1rem;
    border: 1px solid #e5e7eb;
}

.radio-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    cursor: pointer;
    padding: 1rem 1.5rem;
    border-radius: 0.75rem;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    background: white;
    border: 2px solid transparent;
    position: relative;
    overflow: hidden;
}

.radio-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(102, 126, 234, 0.1), transparent);
    transition: left 0.5s;
}

.radio-item:hover::before {
    left: 100%;
}

.radio-item:hover {
    background: white;
    border-color: #667eea;
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.15);
}

.radio-item input {
    width: 20px;
    height: 20px;
    accent-color: #667eea;
}

.radio-item span {
    font-size: 1rem;
    font-weight: 600;
    color: #374151;
}

.radio-item input:checked + span {
    color: #667eea;
}

/* Signature Area */
.signature-area {
    border: 2px dashed #d1d5db;
    border-radius: 1rem;
    padding: 2rem;
    height: 8rem;
    display: flex;
    align-items: flex-end;
    background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.signature-area::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(102, 126, 234, 0.05), transparent);
    transition: left 0.8s;
}

.signature-area:hover::before {
    left: 100%;
}

.signature-area:hover {
    border-color: #667eea;
    background: linear-gradient(135deg, #f0f4ff 0%, #e0e7ff 100%);
    transform: translateY(-1px);
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.1);
}

.signature-input {
    width: 100%;
    text-align: center;
    border: none;
    outline: none;
    font-size: 1.125rem;
    background: transparent;
}

/* Kilometer Grid */
.km-grid {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 0.75rem;
}

/* Border Bottom */
.border-bottom {
    border-bottom: 2px solid #e5e7eb;
    padding-bottom: 0.5rem;
}

/* Footer */
.footer {
    background: #f3f4f6;
    padding: 1rem 1.5rem;
    text-align: center;
    font-size: 0.875rem;
    color: #6b7280;
}

/* Saved Forms Panel */
.saved-forms-panel {
    background: #f3f4f6;
    border-bottom: 1px solid #e5e7eb;
    padding: 1rem;
}

.saved-form-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: white;
    padding: 0.75rem;
    border-radius: 0.5rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    margin-bottom: 0.5rem;
}

.saved-form-info {
    flex: 1;
}

.saved-form-title {
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.saved-form-meta {
    font-size: 0.75rem;
    color: #6b7280;
}

.saved-form-actions {
    display: flex;
    gap: 0.5rem;
}

/* Utility Classes */
.hidden {
    display: none;
}

/* Messages */
.message {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 12px 20px;
    border-radius: 8px;
    color: white;
    font-weight: 600;
    z-index: 1000;
    animation: slideIn 0.3s ease;
}

.message-success { 
    background-color: #22c55e; 
}

.message-error { 
    background-color: #ef4444; 
}

.message-info { 
    background-color: #3b82f6; 
}

@keyframes slideIn {
    from { 
        transform: translateX(100%); 
        opacity: 0; 
    }
    to { 
        transform: translateX(0); 
        opacity: 1; 
    }
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
}

.modal-content {
    background-color: white;
    margin: 15% auto;
    padding: 20px;
    border-radius: 8px;
    width: 80%;
    max-width: 500px;
}

.close {
    color: #aaa;
    float: right;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
}

.close:hover {
    color: black;
}

/* Responsive Design - Mobile Optimiert */
@media (max-width: 768px) {
    body {
        padding: 0.5rem;
    }
    
    .container {
        border-radius: 0.5rem;
        margin: 0;
        max-width: 100%;
    }
    
    .header {
        padding: 1rem;
    }
    
    .header-content {
        margin-top: 60px;
        flex-direction: column;
        align-items: stretch;
        gap: 1rem;
    }
    
    .header-title h1 {
        font-size: 1.25rem;
    }
    
    .header-title p {
        font-size: 0.875rem;
    }
    
    .header-logo-container {
        position: relative;
        top: auto;
        right: auto;
        text-align: center;
        margin-bottom: 1rem;
    }
    
    .header-logo {
        height: 60px;
        max-width: 150px;
    }
    
    .header-buttons {
        justify-content: center;
        flex-wrap: wrap;
    }
    
    .header-buttons .btn-text {
        display: none;
    }
    
    .header-buttons .btn {
        padding: 0.75rem;
        min-width: 44px;
        min-height: 44px;
        justify-content: center;
    }
    
    .content {
        padding: 1rem;
    }
    
    .section {
        padding: 1rem;
        margin-bottom: 1rem;
    }
    
    .form-grid-2 {
        grid-template-columns: 1fr;
    }
    
    .form-grid-4 {
        grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    }
    
    .form-grid-6 {
        grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
    }
    
    .radio-group {
        grid-template-columns: 1fr;
        padding: 1rem;
    }
    
    .radio-item {
        padding: 0.75rem 1rem;
    }
    
    .km-grid {
        grid-template-columns: 1fr;
        gap: 0.5rem;
    }
    
    .form-input {
        padding: 0.875rem;
        font-size: 16px; /* Verhindert Zoom auf iOS */
    }
    
    .signature-area {
        height: 6rem;
        padding: 1rem;
    }
    
    .btn {
        padding: 0.875rem 1rem;
        font-size: 0.875rem;
        min-height: 44px;
    }
    
    .btn-small {
        padding: 0.5rem 0.75rem;
        font-size: 0.75rem;
        min-height: 36px;
    }
}

@media (max-width: 480px) {
    .header-buttons {
        gap: 0.25rem;
    }
    
    .header-buttons .btn {
        padding: 0.5rem;
        min-width: 40px;
        min-height: 40px;
    }
    
    .form-grid-4 {
        grid-template-columns: 1fr 1fr;
    }
    
    .form-grid-6 {
        grid-template-columns: 1fr 1fr;
    }
    
    .section-title {
        font-size: 1rem;
    }
    
    .radio-item span {
        font-size: 0.875rem;
    }
}

/* Print Styles */
@media print {
    body { 
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact; 
        background: white;
    }
    
    .header-buttons, 
    .saved-forms-panel,
    .footer { 
        display: none !important; 
    }
    
    .container { 
        box-shadow: none; 
        width: 100%;
        max-width: 100%;
        margin: 0;
        border-radius: 0;
    }
    
    .header-logo-container {
        display: none; /* Logos im Druck ausblenden */
    }

    .header-title h1,
    .header-title h2 {
        font-size: 1.2rem;
    }
    .header-title p {
        font-size: 0.8rem;
    }
    .content,
    .section,
    .form-grid,
    .form-group {
        padding: 0;
        margin: 0.5rem 0;
    }

    /* Reduzieren der Schriftgrößen für den Druck */
    .form-label,
    .form-input,
    .radio-item span,
    .section-title {
        font-size: 0.8rem;
    }

    /* Leere Felder besser sichtbar machen */
    .form-input:placeholder-shown {
        border-bottom: 1px dotted black;
    }
    
    .form-input,
    .textarea {
        border: none;
    }
}