:root {
    --bg-primary: #f5f5f5;
    --bg-secondary: #ffffff;
    --bg-tertiary: #f9f9f9;
    --text-primary: #333;
    --text-secondary: #555;
    --text-muted: #666;
    --border-color: #ddd;
    --input-bg: #ffffff;
    --input-border: #ccc;
    --accent-color: #2c5f2d;
    --accent-hover: #3d7d3f;
    --shadow: rgba(0, 0, 0, 0.1);
    --shadow-hover: rgba(0, 0, 0, 0.15);
}

body.dark-mode {
    --bg-primary: #1a1a1a;
    --bg-secondary: #2d2d2d;
    --bg-tertiary: #252525;
    --text-primary: #e0e0e0;
    --text-secondary: #b0b0b0;
    --text-muted: #888;
    --border-color: #444;
    --input-bg: #2d2d2d;
    --input-border: #555;
    --accent-color: #4a9d4f;
    --accent-hover: #5bb861;
    --shadow: rgba(0, 0, 0, 0.4);
    --shadow-hover: rgba(0, 0, 0, 0.6);
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background-color: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    transition: background-color 0.3s ease, color 0.3s ease;
}

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

header {
    background-color: var(--accent-color);
    color: white;
    padding: 10px;
    border-radius: 8px;
    margin-bottom: 20px;
    position: relative;
}

header h1 {
    margin: 0;
    font-size: 1.2rem;
    text-align: center;
}

.dark-mode-btn {
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.2);
    border: none;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
    transition: background 0.3s ease;
}

.dark-mode-btn:hover {
    background: rgba(255, 255, 255, 0.3);
}

body:not(.dark-mode) .dark-mode-btn .icon-moon {
    display: none;
}

body.dark-mode .dark-mode-btn .icon-sun {
    display: none;
}

nav {
    display: flex;
    gap: 10px;
}

.nav-btn {
    flex: 1;
    padding: 12px;
    border: none;
    background-color: rgba(255, 255, 255, 0.2);
    color: white;
    cursor: pointer;
    border-radius: 5px;
    font-size: 1rem;
    transition: background-color 0.3s;
}

.nav-btn:hover {
    background-color: rgba(255, 255, 255, 0.3);
}

.nav-btn.active {
    background-color: white;
    color: var(--accent-color);
    font-weight: bold;
}

section {
    background-color: var(--bg-secondary);
    padding: 25px;
    border-radius: 8px;
    box-shadow: 0 2px 8px var(--shadow);
}

section.hidden {
    display: none;
}

.form-group {
    margin-bottom: 20px;
}

label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: var(--text-secondary);
}

input[type="text"],
input[type="date"],
input[type="time"],
select,
textarea {
    width: 100%;
    padding: 12px;
    border: 2px solid var(--input-border);
    border-radius: 5px;
    font-size: 1rem;
    transition: border-color 0.3s;
    font-family: inherit;
    background-color: var(--input-bg);
    color: var(--text-primary);
}

input[type="number"] {
    width: 100%;
    padding: 14px;
    border: 2px solid var(--input-border);
    border-radius: 5px;
    font-size: 1.3rem;
    font-weight: 600;
    transition: border-color 0.3s;
    font-family: inherit;
    background-color: var(--input-bg);
    color: var(--text-primary);
}

textarea {
    resize: vertical;
    min-height: 80px;
}

input:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: var(--accent-color);
}

/* Info Text */
.info-text {
    margin: 15px 0;
    padding: 10px;
    background-color: var(--bg-tertiary);
    border-left: 3px solid var(--accent-color);
    border-radius: 3px;
    text-align: center;
}

.info-text small {
    color: var(--text-secondary);
}

/* DateTime Row */
.datetime-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
    margin-bottom: 20px;
}

.btn-group {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.wildart-btn,
.gender-btn {
    padding: 10px 20px;
    border: 2px solid var(--border-color);
    background-color: var(--bg-secondary);
    color: var(--text-primary);
    cursor: pointer;
    border-radius: 5px;
    font-size: 1rem;
    transition: all 0.3s;
    flex: 0 1 auto;
    min-width: fit-content;
}

.wildart-btn:hover,
.gender-btn:hover {
    border-color: var(--accent-color);
    background-color: var(--bg-tertiary);
}

.wildart-btn.selected,
.gender-btn.selected,
.herkunft-btn.selected,
.revier-btn.selected {
    background-color: var(--accent-color);
    color: white;
    border-color: var(--accent-color);
}

/* Vertical Button Group */
.btn-group-vertical {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.herkunft-btn,
.revier-btn {
    padding: 12px;
    border: 2px solid var(--border-color);
    background-color: var(--bg-secondary);
    color: var(--text-primary);
    cursor: pointer;
    border-radius: 5px;
    font-size: 1rem;
    transition: all 0.3s;
    text-align: left;
}

.herkunft-btn:hover,
.revier-btn:hover {
    border-color: var(--accent-color);
    background-color: var(--bg-tertiary);
}

.form-actions {
    display: flex;
    gap: 10px;
    margin-top: 25px;
}

.btn-primary,
.btn-secondary {
    flex: 1;
    padding: 15px;
    border: none;
    border-radius: 5px;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-primary {
    background-color: var(--accent-color);
    color: white;
}

.btn-primary:hover {
    background-color: var(--accent-hover);
}

.btn-secondary {
    background-color: var(--border-color);
    color: var(--text-primary);
}

.btn-secondary:hover {
    background-color: var(--input-border);
}

.hidden {
    display: none !important;
}

/* Toggle Switch für Fallwild */
.toggle-label {
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    user-select: none;
}

.toggle-checkbox {
    display: none;
}

.toggle-switch {
    position: relative;
    width: 50px;
    height: 26px;
    background-color: var(--border-color);
    border-radius: 13px;
    transition: background-color 0.3s ease;
}

.toggle-switch::after {
    content: '';
    position: absolute;
    top: 3px;
    left: 3px;
    width: 20px;
    height: 20px;
    background-color: white;
    border-radius: 50%;
    transition: transform 0.3s ease;
}

.toggle-checkbox:checked + .toggle-switch {
    background-color: var(--accent-color);
}

.toggle-checkbox:checked + .toggle-switch::after {
    transform: translateX(24px);
}

.toggle-text,
.toggle-text-left {
    font-size: 0.95rem;
    color: var(--text-secondary);
    font-weight: 500;
}

.toggle-checkbox:checked ~ .toggle-text {
    color: var(--text-primary);
    font-weight: 500;
}

/* Checkbox Label */
.checkbox-label {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    font-weight: 500;
}

.checkbox-label input[type="checkbox"] {
    width: 20px;
    height: 20px;
    cursor: pointer;
    accent-color: #2c5f2d;
}

.checkbox-label span {
    user-select: none;
}

/* Image Upload */
#bild-upload {
    padding: 10px;
    border: 2px dashed #ddd;
    border-radius: 5px;
    cursor: pointer;
    width: 100%;
}

#bild-upload:hover {
    border-color: #2c5f2d;
    background-color: #f0f8f0;
}

#bild-preview {
    margin-top: 15px;
    text-align: center;
}

#bild-preview-img {
    max-width: 100%;
    max-height: 300px;
    border-radius: 5px;
    margin-bottom: 10px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

#btn-remove-image {
    padding: 8px 15px;
    font-size: 0.9rem;
}

.upload-status {
    margin-top: 10px;
    padding: 10px;
    border-radius: 5px;
    text-align: center;
    font-weight: 500;
}

.upload-status.info {
    background-color: #d1ecf1;
    color: #0c5460;
}

.upload-status.success {
    background-color: #d4edda;
    color: #155724;
}

.upload-status.error {
    background-color: #f8d7da;
    color: #721c24;
}

/* Filter Section */
.filter-section {
    background-color: #f9f9f9;
    padding: 20px;
    border-radius: 5px;
    margin-bottom: 20px;
}

.filter-section h2 {
    margin-bottom: 15px;
    color: #2c5f2d;
}

#btn-filter,
#btn-export {
    margin-top: 15px;
    margin-right: 10px;
}

/* Results Section */
.results-section h2 {
    margin-bottom: 15px;
    color: #2c5f2d;
}

#data-table {
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 15px;
}

table th,
table td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid #ddd;
}

table th {
    background-color: #2c5f2d;
    color: white;
    font-weight: 600;
}

table tr:hover {
    background-color: #f5f5f5;
}

.delete-btn {
    background-color: #dc3545;
    color: white;
    border: none;
    padding: 6px 12px;
    border-radius: 3px;
    cursor: pointer;
    font-size: 0.9rem;
}

.delete-btn:hover {
    background-color: #c82333;
}
/* Mobile Responsive */
/* Notification */
.notification {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 15px 20px;
    border-radius: 5px;
    color: white;
    font-weight: 600;
    z-index: 2000;
    opacity: 0;
    transform: translateY(-20px);
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.notification.show {
    opacity: 1;
    transform: translateY(0);
}

.notification-success {
    background-color: #28a745;
}

.notification-warning {
    background-color: #ffc107;
    color: #333;
}

.notification-error {
    background-color: #dc3545;
}

.notification-info {
    background-color: #17a2b8;
}

.notification-warning {
    background-color: #ff9800;
    color: white;
}

/* Time Picker */
.time-picker {
    display: flex;
    align-items: center;
    gap: 10px;
}

.time-picker select {
    flex: 1;
    min-width: 80px;
}

.time-separator {
    font-size: 1.5rem;
    font-weight: bold;
    color: #2c5f2d;
}

/* Info Box for Auswertung */
.info-box {
    background-color: #f0f8f0;
    border: 2px solid #2c5f2d;
    border-radius: 8px;
    padding: 30px;
    text-align: center;
}

.info-box h2 {
    color: #2c5f2d;
    margin-bottom: 20px;
}

.info-box ul {
    text-align: left;
    max-width: 500px;
    margin: 20px auto;
    list-style-position: inside;
}

.info-box li {
    margin: 10px 0;
    font-size: 1rem;
}

/* Modal Styles */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    animation: fadeIn 0.3s ease;
}

.modal.hidden {
    display: none;
}

.modal-content {
    background: var(--bg-secondary);
    border-radius: 12px;
    box-shadow: 0 10px 40px var(--shadow-hover);
    max-width: 600px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    animation: slideIn 0.3s ease;
}

.modal-header {
    background-color: var(--accent-color);
    color: white;
    padding: 20px;
    border-radius: 12px 12px 0 0;
    text-align: center;
}

.modal-header h2 {
    margin: 0;
    font-size: 1.5rem;
}

.modal-body {
    padding: 30px;
}

.modal-body p {
    margin-bottom: 20px;
    font-size: 1.1rem;
    color: var(--text-primary);
}

#success-details {
    background-color: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 20px;
}

#success-details table {
    width: 100%;
    border-collapse: collapse;
}

#success-details tr {
    border-bottom: 1px solid var(--border-color);
}

#success-details tr:last-child {
    border-bottom: none;
}

#success-details td {
    padding: 12px 8px;
    font-size: 0.95rem;
}

#success-details td:first-child {
    font-weight: 600;
    color: var(--text-secondary);
    width: 40%;
}

#success-details td:last-child {
    color: var(--text-primary);
}

.modal-actions {
    padding: 20px 30px;
    display: flex;
    gap: 15px;
    justify-content: center;
    border-top: 1px solid var(--border-color);
}

.modal-actions button {
    flex: 1;
    max-width: 200px;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

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

@media (max-width: 600px) {
    .container {
        padding: 10px;
    }

    header h1 {
        font-size: 1.5rem;
    }

    .nav-btn {
        font-size: 0.9rem;
        padding: 10px;
    }

    section {
        padding: 15px;
    }

    .btn-group {
        grid-template-columns: 1fr;
    }
    
    .datetime-row {
        grid-template-columns: 1fr;
    }

    .form-actions {
        flex-direction: column;
    }

    table th,
    table td {
        padding: 8px;
        font-size: 0.9rem;
    }
    
    .notification {
        right: 10px;
        left: 10px;
        top: 10px;
    }
    
    .modal-content {
        width: 95%;
        margin: 10px;
    }
    
    .modal-header h2 {
        font-size: 1.2rem;
    }
    
    .modal-body {
        padding: 20px;
    }
    
    .modal-actions {
        padding: 15px 20px;
        flex-direction: column;
    }
    
    .modal-actions button {
        max-width: 100%;
    }
    
    #success-details td {
        font-size: 0.85rem;
        padding: 8px 4px;
    }
}
