/* Tailwind CSS Import */
@import url('https://cdn.jsdelivr.net/npm/tailwindcss@2.2.19/dist/tailwind.min.css');

/* Custom Styles für Mobile-First Design */

/* Basis Styles */
* {
    box-sizing: border-box;
}

html, body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Mobile Touch Optimierung */
button, .btn, select, input[type="button"], input[type="submit"] {
    min-height: 44px;
    min-width: 44px;
    touch-action: manipulation;
}

/* Kalender spezifische Styles */
.calendar-day {
    min-height: 120px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.calendar-day:hover {
    background-color: #f9fafb;
    transform: translateY(-1px);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.calendar-day.today {
    background-color: #ecfdf5;
    border: 2px solid #059669;
}

.recipe-card {
    background: white;
    border-radius: 8px;
    padding: 8px;
    margin: 2px 0;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    font-size: 11px;
    line-height: 1.3;
}

.recipe-card.main {
    background-color: #dbeafe;
    color: #1e40af;
    border-left: 3px solid #3b82f6;
}

.recipe-card.baking {
    background-color: #fed7aa;
    color: #c2410c;
    border-left: 3px solid #ea580c;
}

/* Mobile Navigation */
.mobile-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: white;
    border-top: 1px solid #e5e7eb;
    z-index: 40;
    padding: env(safe-area-inset-bottom);
}

.mobile-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 8px;
    text-decoration: none;
    color: #6b7280;
    transition: color 0.2s ease;
}

.mobile-nav-item.active,
.mobile-nav-item:hover {
    color: #059669;
}

.mobile-nav-item svg {
    width: 24px;
    height: 24px;
    margin-bottom: 4px;
}

.mobile-nav-item span {
    font-size: 12px;
    font-weight: 500;
}

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

.form-label {
    display: block;
    font-size: 14px;
    font-weight: 500;
    color: #374151;
    margin-bottom: 4px;
}

.form-input,
.form-select,
.form-textarea {
    width: 100%;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    padding: 12px;
    font-size: 16px; /* Verhindert Zoom auf iOS */
    background: white;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
    outline: none;
    border-color: #059669;
    box-shadow: 0 0 0 3px rgba(5, 150, 105, 0.1);
}

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

/* Button Styles */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 500;
    border-radius: 6px;
    padding: 12px 16px;
    font-size: 14px;
    transition: all 0.2s ease;
    cursor: pointer;
    border: none;
    text-decoration: none;
}

.btn-primary {
    background-color: #059669;
    color: white;
}

.btn-primary:hover {
    background-color: #047857;
}

.btn-secondary {
    background-color: #f3f4f6;
    color: #374151;
    border: 1px solid #d1d5db;
}

.btn-secondary:hover {
    background-color: #e5e7eb;
}

.btn-danger {
    background-color: #dc2626;
    color: white;
}

.btn-danger:hover {
    background-color: #b91c1c;
}

.btn-sm {
    padding: 8px 12px;
    font-size: 12px;
}

.btn-lg {
    padding: 16px 24px;
    font-size: 16px;
}

/* Modal Styles */
.modal {
    position: fixed;
    inset: 0;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 50;
    padding: 16px;
}

.modal.hidden {
    display: none;
}

.modal-content {
    background: white;
    border-radius: 12px;
    padding: 24px;
    width: 100%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
}

.modal-header {
    display: flex;
    justify-content: between;
    align-items: center;
    margin-bottom: 16px;
    padding-bottom: 16px;
    border-bottom: 1px solid #e5e7eb;
}

.modal-title {
    font-size: 18px;
    font-weight: 600;
    color: #111827;
}

/* Einkaufsliste Styles */
.shopping-item {
    display: flex;
    align-items: center;
    padding: 12px;
    border-bottom: 1px solid #f3f4f6;
    transition: background-color 0.2s ease;
}

.shopping-item:hover {
    background-color: #f9fafb;
}

.shopping-item.checked {
    opacity: 0.6;
    text-decoration: line-through;
}

.shopping-checkbox {
    margin-right: 12px;
    width: 20px;
    height: 20px;
    accent-color: #059669;
}

.shopping-category {
    background-color: #f3f4f6;
    padding: 8px 16px;
    font-weight: 600;
    font-size: 14px;
    color: #374151;
    border-bottom: 1px solid #e5e7eb;
    position: sticky;
    top: 0;
    z-index: 10;
}

.supermarket-section {
    margin-bottom: 24px;
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.supermarket-header {
    background-color: #059669;
    color: white;
    padding: 12px 16px;
    font-weight: 600;
    display: flex;
    justify-content: between;
    align-items: center;
}

/* Loading Spinner */
.spinner {
    border: 2px solid #f3f4f6;
    border-top: 2px solid #059669;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Toast Notifications */
.toast {
    position: fixed;
    top: 20px;
    right: 20px;
    background: white;
    border-radius: 8px;
    padding: 16px;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    z-index: 60;
    max-width: 350px;
    transform: translateX(100%);
    transition: transform 0.3s ease;
}

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

.toast.success {
    border-left: 4px solid #10b981;
}

.toast.error {
    border-left: 4px solid #ef4444;
}

.toast.warning {
    border-left: 4px solid #f59e0b;
}

/* Responsive Design */
@media (max-width: 640px) {
    .modal-content {
        margin: 16px;
        padding: 16px;
    }
    
    .calendar-day {
        min-height: 100px;
        font-size: 12px;
    }
    
    .recipe-card {
        font-size: 10px;
        padding: 6px;
    }
    
    /* Mobile Bottom Navigation */
    body {
        padding-bottom: 80px;
    }
}

@media (min-width: 768px) {
    .mobile-nav {
        display: none;
    }
    
    body {
        padding-bottom: 0;
    }
}

/* PWA Styles */
@media (display-mode: standalone) {
    body {
        padding-top: env(safe-area-inset-top);
        padding-bottom: env(safe-area-inset-bottom);
    }
}

/* Dark Mode Support */
@media (prefers-color-scheme: dark) {
    /* Hier können Dark Mode Styles hinzugefügt werden */
}

/* Print Styles */
@media print {
    .mobile-nav,
    .btn,
    button {
        display: none !important;
    }
    
    .shopping-item {
        break-inside: avoid;
    }
    
    .supermarket-section {
        break-inside: avoid;
        margin-bottom: 20px;
    }
}

/* Accessibility */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Focus Styles für Keyboard Navigation */
button:focus-visible,
.btn:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
    outline: 2px solid #059669;
    outline-offset: 2px;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f5f9;
}

::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}