/* Global Styles */
html, body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    margin: 0;
    padding: 0;
    background-color: #f8f9fa;
    color: #212529;
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
    -webkit-tap-highlight-color: transparent;
}

/* Bootstrap Overrides */
.form-control {
    display: block;
    width: 100%;
    padding: 0.375rem 0.75rem;
    font-size: 1rem;
    font-weight: 400;
    line-height: 1.5;
    color: #212529;
    background-color: #fff;
    background-clip: padding-box;
    border: 1px solid #ced4da;
    border-radius: 0.375rem;
    transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
}

.form-control:focus {
    color: #212529;
    background-color: #fff;
    border-color: #2ecc71;
    outline: 0;
    box-shadow: 0 0 0 0.25rem rgba(46, 204, 113, 0.25);
}

.spinner-border {
    display: inline-block;
    width: 2rem;
    height: 2rem;
    vertical-align: text-bottom;
    border: 0.25em solid currentColor;
    border-right-color: transparent;
    border-radius: 50%;
    animation: spinner-border 0.75s linear infinite;
}

.spinner-border-sm {
    width: 1rem;
    height: 1rem;
    border-width: 0.2em;
}

.text-success {
    color: #2ecc71 !important;
}

@keyframes spinner-border {
    to { transform: rotate(360deg); }
}

/* Layout */
.page {
    position: relative;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    background-color: #f8f9fa;
    max-width: 100vw;
    overflow-x: hidden;
}

.version-info {
    font-size: 0.6rem;
    color: #6c757d;
    text-align: center;
    padding: 2px 0;
    opacity: 0.7;
    background-color: #f8f9fa;
    border-bottom: 1px solid #dee2e6;
}

.container {
    width: 100%;
    max-width: 800px;
    margin: 0 auto;
    padding: 1rem;
    padding-bottom: 5rem;
    box-sizing: border-box;
}

.content {
    max-width: 800px;
    margin: 0 auto;
    padding: 1rem;
}

@media (max-width: 640.98px) {
    .content {
        padding: 0.5rem;
    }
}

/* Header */
.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.header h1 {
    margin: 0;
    font-size: clamp(1.5rem, 5vw, 2rem);
    font-weight: 600;
    color: #2ecc71;
    white-space: nowrap;
    -webkit-user-select: none;
    user-select: none;
    outline: none;
    -webkit-tap-highlight-color: transparent;
}

.header h1:focus {
    outline: none;
    box-shadow: none;
}

.shares-badge {
    background-color: #2ecc71;
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 2rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
    white-space: nowrap;
    box-shadow: 0 2px 4px rgba(46, 204, 113, 0.2);
    margin-left: auto;
}

.shares-badge i {
    font-size: 1.1rem;
}

.shares-badge.highlight {
    background-color: #2ecc71;
    color: white;
}

/* Navigation */
.nav-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background-color: white;
    display: flex;
    justify-content: space-around;
    padding: 0.5rem;
    padding-bottom: calc(0.5rem + env(safe-area-inset-bottom));
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.05);
    z-index: 1000;
}

.nav-item {
    color: #6c757d;
    text-decoration: none;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.25rem;
    padding: 0.5rem;
    border-radius: 0.5rem;
    font-size: 0.8rem;
    min-width: 60px;
    transition: all 0.2s ease;
}

.nav-item:hover {
    color: #2ecc71;
    background-color: #f8f9fa;
}

.nav-item.active {
    color: #2ecc71;
    background-color: #f0fff4;
}

.nav-item i {
    font-size: 1.1rem;
}

/* Welcome Screen */
.welcome {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    background-color: #2ecc71;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    transition: opacity 0.5s ease-out;
}

.welcome.visible {
    opacity: 1;
}

.welcome.hidden {
    opacity: 0;
    pointer-events: none;
}

.welcome-content {
    text-align: center;
    color: white;
    animation: scaleIn 0.5s ease-out;
}

.welcome .logo {
    font-size: 4rem;
    margin-bottom: 1rem;
    animation: bounce 1s ease-in-out;
}

.welcome-content h1 {
    font-size: 2rem;
    margin: 0;
    font-weight: 600;
}

.welcome-content p {
    font-size: 1.2rem;
    margin: 0.5rem 0 0 0;
    opacity: 0.9;
}

/* Toast Notifications - Simple Version */
.simple-toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 9999;
}

.simple-toast {
    background: white;
    min-width: 300px;
    margin-bottom: 10px;
    padding: 15px;
    border-radius: 4px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
    display: flex;
    align-items: center;
    gap: 10px;
}

.simple-toast i {
    font-size: 20px;
}

.simple-toast.success {
    border-left: 4px solid #4caf50;
}
.simple-toast.success i {
    color: #4caf50;
}

.simple-toast.error {
    border-left: 4px solid #f44336;
}
.simple-toast.error i {
    color: #f44336;
}

.simple-toast.warning {
    border-left: 4px solid #ff9800;
}
.simple-toast.warning i {
    color: #ff9800;
}

.simple-toast.info {
    border-left: 4px solid #2196f3;
}
.simple-toast.info i {
    color: #2196f3;
}

/* Forms */
.form-group {
    margin-bottom: 1rem;
    width: 100%;
}

.form-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
    color: #495057;
    font-weight: 500;
}

.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 1rem;
}

.input-validation {
    position: relative;
}

.input-validation.is-valid .form-control {
    border-color: #2ecc71;
}

.input-validation.is-invalid .form-control {
    border-color: #e74c3c;
}

.invalid-feedback {
    color: #e74c3c;
    font-size: 0.875rem;
    margin-top: 0.25rem;
}

/* Buttons */
.action-button {
    background-color: #2ecc71;
    color: white;
    border: none;
    border-radius: 0.5rem;
    padding: 0.75rem 1.25rem;
    font-size: 0.95rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    height: 2.75rem;
    min-width: auto;
    width: auto;
    gap: 0.5rem;
    white-space: nowrap;
}

.action-button i {
    color: white;
    font-size: 1rem;
    display: inline-block;
    vertical-align: middle;
}

.action-button span {
    line-height: 1;
    display: inline-flex;
    align-items: center;
}

.action-button:hover {
    background-color: #27ae60;
    color: white;
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(46, 204, 113, 0.2);
}

.action-button.submit {
    background-color: #3498db;
}

.action-button.submit:hover {
    background-color: #2980b9;
    box-shadow: 0 2px 4px rgba(52, 152, 219, 0.2);
}

.action-button:disabled {
    background-color: #95a5a6;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* Cards */
.capture-card, .info-card {
    background-color: white;
    border-radius: 1rem;
    padding: 1rem;
    margin-bottom: 1rem;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.capture-card {
    text-align: center;
}

.preview-image {
    max-width: 100%;
    border-radius: 0.5rem;
    margin-top: 1rem;
}

/* Harvest List */
.harvest-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.harvest-card {
    background: white;
    border-radius: 1rem;
    padding: 1rem;
    margin-bottom: 1rem;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    width: 100%;
    box-sizing: border-box;
}

.harvest-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.harvest-title {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: #2ecc71;
}

.harvest-title h2 {
    margin: 0;
    font-size: 1.25rem;
    font-weight: 600;
}

.harvest-details {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 0.75rem;
    margin-top: 0.75rem;
}

.detail-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
}

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

.harvest-actions button {
    background-color: #2ecc71;
    color: white;
    border: none;
    border-radius: 0.5rem;
    padding: 0.5rem;
    height: 2.5rem;
    width: 2.5rem;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.harvest-actions button:hover {
    background-color: #27ae60;
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(46, 204, 113, 0.2);
}

.harvest-actions button.delete {
    background-color: #e74c3c;
}

.harvest-actions button.delete:hover {
    background-color: #c0392b;
    box-shadow: 0 2px 4px rgba(231, 76, 60, 0.2);
}

.action-bar {
    display: flex;
    gap: 0.75rem;
    margin-top: 1rem;
    padding-bottom: 5rem;
    flex-wrap: wrap;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 2rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 50vh;
    color: #6c757d;
}

.empty-icon {
    font-size: 3rem;
    color: #2ecc71;
    margin-bottom: 1rem;
    animation: float 3s ease-in-out infinite;
}

.empty-state p {
    color: #6c757d;
    margin-bottom: 1.5rem;
    font-size: 1.1rem;
}

/* Animations */
@keyframes float {
    0% { transform: translateY(0px); }
    50% { transform: translateY(-10px); }
    100% { transform: translateY(0px); }
}

@keyframes scaleIn {
    from {
        transform: scale(0.8);
        opacity: 0;
    }
    to {
        transform: scale(1);
        opacity: 1;
    }
}

@keyframes bounce {
    0% {
        transform: translateY(-20px);
        opacity: 0;
    }
    50% {
        transform: translateY(10px);
    }
    100% {
        transform: translateY(0);
        opacity: 1;
    }
}

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

@keyframes slideOut {
    0% {
        transform: translateX(0);
        opacity: 1;
    }
    100% {
        transform: translateX(100%);
        opacity: 0;
    }
}

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

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

/* Responsive Header */
@media (max-width: 480px) {
    .container {
        padding: 0.75rem;
    }

    .harvest-card {
        padding: 0.75rem;
    }

    .action-button {
        flex: 1;
        min-width: 120px;
    }

    .action-bar {
        justify-content: stretch;
    }

    .shares-badge {
        padding: 0.4rem 0.75rem;
        font-size: 0.85rem;
    }

    .nav-item {
        font-size: 0.75rem;
    }
}

.shares-summary {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

@media (max-width: 768px) {
    .shares-summary {
        flex-direction: column;
        gap: 0.5rem;
    }
}

.action-buttons {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

.action-button.debug {
    background-color: #9b59b6;
    min-width: auto;
}

.action-button.debug:hover {
    background-color: #8e44ad;
    box-shadow: 0 2px 4px rgba(155, 89, 182, 0.2);
}

.toast-container {
    padding: max(1rem, env(safe-area-inset-top)) max(1rem, env(safe-area-inset-right)) 0 0;
    width: 100%;
    max-width: 400px;
    pointer-events: none;
}

.toast {
    pointer-events: auto;
    width: calc(100% - 2rem);
    margin: 0 auto;
    background: white;
    min-width: 300px;
    max-width: 400px;
    margin: 0;
    padding: 0;
    border: none;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    overflow: hidden;
    animation: slideInRight 0.3s ease-out;
}

.toast.success .toast-header {
    background-color: #ebf9f1;
    color: #2ecc71;
    border: none;
}

.toast.error .toast-header {
    background-color: #fdf3f2;
    color: #e74c3c;
    border: none;
}

.toast.warning .toast-header {
    background-color: #fef7ec;
    color: #f39c12;
    border: none;
}

.toast.info .toast-header {
    background-color: #ebf5fb;
    color: #3498db;
    border: none;
}

.toast-header {
    padding: 12px 16px;
    background: transparent;
    border-bottom: none;
    display: flex;
    align-items: center;
}

.toast-header i {
    font-size: 18px;
}

.toast-header strong {
    font-weight: 600;
    font-size: 14px;
}

.toast-header .btn-close {
    margin-right: -8px;
    opacity: 0.5;
    transition: opacity 0.2s;
}

.toast-header .btn-close:hover {
    opacity: 1;
}

.toast-body {
    padding: 12px 16px;
    color: #4a5568;
    font-size: 14px;
}

.toast.hide {
    animation: slideOutRight 0.3s ease-out forwards;
}

/* Suggestions Dropdown */
.suggestions {
    position: absolute;
    z-index: 1000;
    background: white;
    max-width: 300px;
    margin-top: 4px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    max-height: 200px;
    overflow-y: auto;
    /* Moderner Scrollbar für Firefox */
    scrollbar-width: thin;
    scrollbar-color: #2ecc71 #f0f0f0;
    width: 100%;
    max-height: 200px;
    border-radius: 0.5rem;
    margin-top: 0.25rem;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

/* Moderner Scrollbar für Chrome/Safari/Edge */
.suggestions::-webkit-scrollbar {
    width: 6px;
}

.suggestions::-webkit-scrollbar-track {
    background: #f0f0f0;
    border-radius: 3px;
}

.suggestions::-webkit-scrollbar-thumb {
    background-color: #2ecc71;
    border-radius: 3px;
}

.suggestion-item {
    padding: 0.75rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    border-bottom: 1px solid #f0f0f0;
    transition: all 0.2s ease;
    font-size: 0.9rem;
}

.suggestion-item:last-child {
    border-bottom: none;
}

.suggestion-item:hover {
    background-color: #f8f9fa;
}

.suggestion-item i {
    color: #2ecc71;
    font-size: 0.9rem;
}

/* Safe Area Support */
@supports (padding: max(0px)) {
    .container {
        padding-left: max(1rem, env(safe-area-inset-left));
        padding-right: max(1rem, env(safe-area-inset-right));
    }

    .nav-bar {
        padding-bottom: max(0.5rem, env(safe-area-inset-bottom));
        padding-left: max(0.5rem, env(safe-area-inset-left));
        padding-right: max(0.5rem, env(safe-area-inset-right));
    }
} 