:root {
    --primary-color: #3a86ff;
    --primary-light: #a2d2ff;
    --primary-dark: #1155cc;
    --accent-color: #ff6b6b;
    --success-color: #4caf50;
    --warning-color: #ff9f1c;
    --danger-color: #e63946;
    --text-color: #333;
    --text-light: #666;
    --background-color: #f8f9fa;
    --card-color: #ffffff;
    --border-color: #e0e0e0;
    --shadow-color: rgba(0, 0, 0, 0.1);
    --border-radius-sm: 8px;
    --border-radius: 12px;
    --border-radius-lg: 16px;
    --transition: all 0.3s ease;
}

/* Dark mode */
@media (prefers-color-scheme: dark) {
    :root {
        --primary-color: #4f8bff;
        --primary-light: #75a9ff;
        --primary-dark: #1f66e5;
        --accent-color: #ff7b7b;
        --success-color: #5cba61;
        --warning-color: #ffae3d;
        --danger-color: #f54e5b;
        --text-color: #e5e5e5;
        --text-light: #adadad;
        --background-color: #121212;
        --card-color: #1e1e1e;
        --border-color: #333333;
        --shadow-color: rgba(0, 0, 0, 0.5);
    }
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Roboto', sans-serif;
    background-color: var(--background-color);
    color: var(--text-color);
    line-height: 1.6;
    padding: 0;
    margin: 0;
    min-height: 100vh;
}

.app-container {
    max-width: 768px;
    margin: 0 auto;
    padding: 1rem;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

header {
    display: flex;
    justify-content: flex-end;
    padding: 0.5rem 0;
    margin-bottom: 1rem;
}

.language-selector {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.language-selector label {
    color: var(--primary-color);
    font-size: 1.25rem;
}

select {
    background-color: var(--card-color);
    color: var(--text-color);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-sm);
    padding: 0.5rem 0.75rem;
    font-size: 0.9rem;
    appearance: none;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23333' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 0.5rem center;
    background-size: 1em;
    padding-right: 2rem;
}

main {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.app-title {
    text-align: center;
    margin-bottom: 1rem;
}

.app-title h1 {
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 700;
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
    background: linear-gradient(to right, #3a86ff, #ff6b6b);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.app-title p {
    color: var(--text-light);
    font-size: 1rem;
}

.upload-container {
    background-color: var(--card-color);
    border: 2px dashed var(--primary-light);
    border-radius: var(--border-radius);
    padding: 2rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition);
    text-align: center;
    gap: 1rem;
    box-shadow: 0 4px 12px var(--shadow-color);
}

.upload-container:hover {
    border-color: var(--primary-color);
    transform: translateY(-2px);
    box-shadow: 0 6px 16px var(--shadow-color);
}

.upload-icon {
    font-size: 2.5rem;
    color: var(--primary-color);
    display: flex;
    gap: 0.5rem;
}

.upload-text {
    font-size: 1.25rem;
    font-weight: 500;
}

.preview-container {
    background-color: var(--card-color);
    border-radius: var(--border-radius);
    overflow: hidden;
    box-shadow: 0 4px 12px var(--shadow-color);
}

.preview-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    border-bottom: 1px solid var(--border-color);
}

.preview-header h3 {
    font-weight: 500;
}

.btn-reset {
    background: none;
    border: none;
    color: var(--text-light);
    font-size: 1.25rem;
    cursor: pointer;
    padding: 0.25rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}

.btn-reset:hover {
    color: var(--danger-color);
    background-color: rgba(230, 57, 70, 0.1);
}

.image-preview-wrapper {
    padding: 1rem;
    display: flex;
    justify-content: center;
}

#imagePreview {
    max-width: 100%;
    max-height: 300px;
    border-radius: var(--border-radius-sm);
}

.btn-analyze {
    width: 100%;
    padding: 1rem;
    background-color: var(--primary-color);
    color: white;
    border: none;
    font-size: 1.125rem;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    transition: var(--transition);
}

.btn-analyze:hover {
    background-color: var(--primary-dark);
}

.btn-analyze:disabled {
    background-color: var(--text-light);
    cursor: not-allowed;
}

.results-container {
    background-color: var(--card-color);
    border-radius: var(--border-radius);
    overflow: hidden;
    box-shadow: 0 4px 12px var(--shadow-color);
}

.results-header {
    padding: 1rem;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.results-header h2 {
    font-size: 1.25rem;
    font-weight: 500;
}

.results-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-share, .btn-copy {
    background: none;
    border: none;
    color: var(--primary-color);
    font-size: 1.125rem;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}

.btn-share:hover, .btn-copy:hover {
    background-color: rgba(58, 134, 255, 0.1);
}

.btn-new {
    background-color: var(--success-color);
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: var(--border-radius-sm);
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: var(--transition);
}

.btn-new:hover {
    background-color: #3d9240;
}

.results-content {
    padding: 1.5rem;
}

.results-section {
    margin-bottom: 1.5rem;
}

.results-section:last-child {
    margin-bottom: 0;
}

.results-section h3 {
    font-size: 1.125rem;
    font-weight: 500;
    margin-bottom: 0.75rem;
    color: var(--primary-color);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.results-section ul {
    padding-left: 1.5rem;
}

.results-section li {
    margin-bottom: 0.5rem;
}

.results-section p {
    margin-bottom: 0.75rem;
}

.loader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.spinner {
    width: 60px;
    height: 60px;
    border: 5px solid rgba(255, 255, 255, 0.2);
    border-top-color: var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 1rem;
}

.loader-text {
    color: white;
    font-size: 1.25rem;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

footer {
    text-align: center;
    padding: 1rem 0;
    color: var(--text-light);
    font-size: 0.875rem;
    margin-top: 2rem;
}

/* Responsive adjustments */
@media (max-width: 480px) {
    .app-title h1 {
        font-size: 2rem;
    }
    
    .upload-icon {
        font-size: 2rem;
    }
    
    .upload-text {
        font-size: 1.125rem;
    }
    
    .results-header {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .results-actions {
        width: 100%;
        justify-content: flex-end;
    }
}
/* Add these styles to the styles.css file */

/* Drag and drop highlight effect */
.upload-container.highlight {
    border-color: var(--primary-color);
    background-color: rgba(58, 134, 255, 0.05);
}

/* Improved section styling */
.results-section h3 i {
    color: var(--primary-color);
}

.results-section ul {
    list-style-type: none;
    padding-left: 0;
}

.results-section ul li {
    position: relative;
    padding-left: 1.5rem;
    margin-bottom: 0.75rem;
}

.results-section ul li:before {
    content: '•';
    color: var(--primary-color);
    position: absolute;
    left: 0.5rem;
}

/* Toast notifications */
.toast {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    background-color: var(--primary-color);
    color: white;
    padding: 0.75rem 1.5rem;
    border-radius: var(--border-radius);
    box-shadow: 0 4px 12px var(--shadow-color);
    z-index: 1000;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.toast.show {
    opacity: 1;
}

/* RTL support for Hebrew */
[dir="rtl"] .results-section ul li {
    padding-left: 0;
    padding-right: 1.5rem;
}

[dir="rtl"] .results-section ul li:before {
    left: auto;
    right: 0.5rem;
}
/* Add these styles to the styles.css file */

/* Enhanced result sections */
.results-section {
    background-color: var(--card-color);
    border-radius: var(--border-radius-sm);
    padding: 1rem;
    margin-bottom: 1.5rem;
    border-left: 4px solid var(--primary-color);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.results-section:nth-child(1) {
    border-left-color: #4caf50; /* Food detected - green */
}

.results-section:nth-child(2) {
    border-left-color: #ff9800; /* Calories - orange */
}

.results-section:nth-child(3) {
    border-left-color: #2196f3; /* Health - blue */
}

.results-section:nth-child(4) {
    border-left-color: #9c27b0; /* Recommendations - purple */
}

.results-section h3 {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-color);
}

.results-section:nth-child(1) h3 i {
    color: #4caf50;
}

.results-section:nth-child(2) h3 i {
    color: #ff9800;
}

.results-section:nth-child(3) h3 i {
    color: #2196f3;
}

.results-section:nth-child(4) h3 i {
    color: #9c27b0;
}

.results-section p {
    margin-bottom: 0.75rem;
    line-height: 1.6;
}

.results-section strong {
    color: var(--primary-dark);
    font-weight: 600;
}

.results-section ul {
    list-style-type: none;
    padding-left: 0;
    margin-bottom: 0.5rem;
}

.results-section ul li {
    position: relative;
    padding-left: 1.5rem;
    margin-bottom: 0.75rem;
    line-height: 1.5;
}

.results-section ul li:before {
    content: '•';
    position: absolute;
    left: 0.5rem;
}

/* Section-specific colors for list markers */
.results-section:nth-child(1) ul li:before {
    color: #4caf50;
}

.results-section:nth-child(2) ul li:before {
    color: #ff9800;
}

.results-section:nth-child(3) ul li:before {
    color: #2196f3;
}

.results-section:nth-child(4) ul li:before {
    color: #9c27b0;
}

/* RTL support */
[dir="rtl"] .results-section {
    border-left: none;
    border-right: 4px solid var(--primary-color);
}

[dir="rtl"] .results-section:nth-child(1) {
    border-right-color: #4caf50;
}

[dir="rtl"] .results-section:nth-child(2) {
    border-right-color: #ff9800;
}

[dir="rtl"] .results-section:nth-child(3) {
    border-right-color: #2196f3;
}

[dir="rtl"] .results-section:nth-child(4) {
    border-right-color: #9c27b0;
}

[dir="rtl"] .results-section ul li {
    padding-left: 0;
    padding-right: 1.5rem;
}

[dir="rtl"] .results-section ul li:before {
    left: auto;
    right: 0.5rem;
}

/* And add these styles for the logo */

.logo {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
}

.logo i {
    font-size: 1.75rem;
    color: var(--primary-color);
}

.logo span {
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 700;
    font-size: 2rem;
    background: linear-gradient(to right, #3a86ff, #ff6b6b);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.app-title h1 {
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 600;
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
    color: var(--text-color);
}

/* Add these styles for the upload buttons */
.upload-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    margin-top: 1rem;
    width: 100%;
    justify-content: center;
}

.upload-option {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 1.25rem;
    gap: 0.75rem;
    background-color: var(--card-color);
    border: 2px solid var(--border-color);
    border-radius: var(--border-radius-sm);
    cursor: pointer;
    transition: var(--transition);
    flex: 1;
    min-width: 120px;
    max-width: 160px;
}

.upload-option:hover {
    transform: translateY(-2px);
    border-color: var(--primary-color);
    box-shadow: 0 4px 12px var(--shadow-color);
}

.upload-option i {
    font-size: 1.75rem;
    color: var(--primary-color);
}

.upload-option:first-child i {
    color: var(--accent-color);
}

.upload-option span {
    font-weight: 500;
}

/* Mobile optimization for upload options */
@media (max-width: 480px) {
    .upload-option {
        min-width: 100px;
        padding: 1rem;
    }
}

/* Add these styles to your styles.css file */

/* Health-specific section styles */
.results-section:nth-child(3) {
    border-left-color: #ff9800; /* Allergens - orange */
}

.results-section:nth-child(4) {
    border-left-color: #673ab7; /* Glycemic impact - purple */
}

.results-section:nth-child(5) {
    border-left-color: #2196f3; /* Health analysis - blue */
}

.results-section:nth-child(6) {
    border-left-color: #e91e63; /* Cholesterol - pink */
}

.results-section:nth-child(7) {
    border-left-color: #f44336; /* Blood pressure - red */
}

.results-section:nth-child(8) {
    border-left-color: #4caf50; /* Recommendations - green */
}

/* Icons for each section */
.results-section:nth-child(3) h3 i {
    color: #ff9800; /* Allergens */
}

.results-section:nth-child(4) h3 i {
    color: #673ab7; /* Glycemic impact */
}

.results-section:nth-child(5) h3 i {
    color: #2196f3; /* Health analysis */
}

.results-section:nth-child(6) h3 i {
    color: #e91e63; /* Cholesterol */
}

.results-section:nth-child(7) h3 i {
    color: #f44336; /* Blood pressure */
}

.results-section:nth-child(8) h3 i {
    color: #4caf50; /* Recommendations */
}

/* RTL support for the new sections */
[dir="rtl"] .results-section:nth-child(3) {
    border-right-color: #ff9800;
    border-left: none;
}

[dir="rtl"] .results-section:nth-child(4) {
    border-right-color: #673ab7;
    border-left: none;
}

[dir="rtl"] .results-section:nth-child(5) {
    border-right-color: #2196f3;
    border-left: none;
}

[dir="rtl"] .results-section:nth-child(6) {
    border-right-color: #e91e63;
    border-left: none;
}

[dir="rtl"] .results-section:nth-child(7) {
    border-right-color: #f44336;
    border-left: none;
}

[dir="rtl"] .results-section:nth-child(8) {
    border-right-color: #4caf50;
    border-left: none;
}
/* Add this to your styles.css */

/* For right-to-left text support */
.results-section div {
    text-align: start; /* Supports both LTR and RTL */
}

/* For the fallback case */
.section-title {
    font-weight: bold;
    margin-top: 1rem;
    margin-bottom: 0.5rem;
    color: var(--primary-color);
}

.section-content {
    margin-bottom: 1rem;
}

/* Add specific RTL support for results */
[dir="rtl"] .results-section h3 {
    text-align: right;
}

[dir="rtl"] .results-section div {
    text-align: right;
}

/* Add these styles to your styles.css file */

/* Description container styles */
.description-container {
    background-color: var(--card-color);
    border-radius: var(--border-radius);
    overflow: hidden;
    box-shadow: 0 4px 12px var(--shadow-color);
}

.description-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    border-bottom: 1px solid var(--border-color);
}

.description-header h3 {
    font-weight: 500;
}

.description-input-wrapper {
    padding: 1rem;
}

/* textarea#foodDescription {
    width: 100%;
    min-height: 150px;
    padding: 1rem;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-sm);
    font-family: inherit;
    font-size: 1rem;
    background-color: var(--card-color);
    color: var(--text-color);
    resize: vertical;
} */

textarea#foodDescription:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(58, 134, 255, 0.2);
}

/* Highlight description button with different color */
#descriptionButton {
    border-color: #4caf50;
}

#descriptionButton i {
    color: #4caf50;
}

#descriptionButton:hover {
    background-color: rgba(76, 175, 80, 0.1);
}

/* RTL support for description */
[dir="rtl"] .description-header h3 {
    text-align: right;
}

[dir="rtl"] textarea#foodDescription {
    text-align: right;
}

/* Enhanced mobile support */
@media (max-width: 576px) {
    /* Improved section display */
    .results-section {
        padding: 0.75rem;
        margin-bottom: 1rem;
    }

    .results-section h3 {
        font-size: 1rem;
        padding-bottom: 0.5rem;
        margin-bottom: 0.5rem;
        display: flex;
        align-items: center;
        justify-content: flex-start;
    }

    [dir="rtl"] .results-section h3 {
        justify-content: flex-end;
    }

    .results-section h3 i {
        margin-right: 0.5rem;
        margin-left: 0;
    }

    [dir="rtl"] .results-section h3 i {
        margin-right: 0;
        margin-left: 0.5rem;
    }

    /* Fix mixed language section headers */
    .results-section h3 .section-key {
        display: none; /* Hide the English section key */
    }

    /* App title and content adjustments */
    .app-title h1 {
        font-size: 1.25rem;
    }

    .app-title p {
        font-size: 0.875rem;
    }

    .logo span {
        font-size: 1.5rem;
    }

    .logo i {
        font-size: 1.25rem;
    }

    /* Make buttons more tappable on mobile */
    .upload-option {
        padding: 1rem;
        min-width: 80px;
    }

    .btn-analyze, 
    .btn-new,
    .btn-share,
    .btn-copy {
        padding: 0.75rem;
    }

    /* Side padding for container */
    .app-container {
        padding: 0.75rem;
    }

    /* Ensure text is readable */
    .results-section p, 
    .results-section li {
        font-size: 0.9rem;
        line-height: 1.4;
    }
}

/* Fix section headers with mixed language content */
.section-header-wrapper {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.section-title {
    display: flex;
    align-items: center;
}

.section-english-key {
    display: none; /* Hidden by default, only shown if needed */
    font-size: 0.75rem;
    opacity: 0.7;
    margin-left: 0.5rem;
}

[dir="rtl"] .section-english-key {
    margin-left: 0;
    margin-right: 0.5rem;
}
/* Add these styles for improved mobile viewing */
@media (max-width: 576px) {
    .nutrient-section {
        border-left: 3px solid #4caf50 !important;
    }
    
    .health-section {
        border-left: 3px solid #ff9800 !important;
    }
    
    [dir="rtl"] .nutrient-section {
        border-left: none !important;
        border-right: 3px solid #4caf50 !important;
    }
    
    [dir="rtl"] .health-section {
        border-left: none !important;
        border-right: 3px solid #ff9800 !important;
    }
    
    /* Add more space between sections */
    .results-section {
        margin-bottom: 1.25rem;
    }
    
    /* Make section grouping more obvious */
    .results-section:first-child,
    .health-section:first-of-type {
        border-top: 1px solid var(--border-color);
        padding-top: 1rem;
        margin-top: 1rem;
    }
    
    /* Use slimmer fonts and tighter spacing */
    .results-section p {
        margin-bottom: 0.5rem;
    }
    
    /* Fix section titles on mobile */
    .results-section h3 {
        font-size: 1.1rem;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }
}

/* Visual improvements for all devices */
.results-section {
    transition: all 0.3s ease;
}

.results-section:hover {
    box-shadow: 0 8px 16px rgba(0,0,0,0.1);
}


/* Improved textarea styling */
textarea#foodDescription {
    width: 100%;
    min-height: 150px;
    padding: 1rem;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-sm);
    font-family: inherit;
    font-size: 1rem;
    background-color: var(--card-color);
    color: var(--text-color);
    resize: vertical;
    margin-bottom: 1rem;
    /* iOS-specific improvements */
    -webkit-appearance: none;
    appearance: none;
}

/* Make button more visible on mobile */
#analyzeDescriptionButton {
    margin-top: 0.5rem;
    padding: 1rem;
    font-size: 1.125rem;
    border-radius: 0 0 var(--border-radius) var(--border-radius);
}

/* Improved styling for description container on mobile */
@media (max-width: 576px) {
    .description-container {
        margin-bottom: 1rem;
    }
    
    .description-header {
        padding: 0.75rem 1rem;
    }
    
    .description-input-wrapper {
        padding: 0.75rem;
    }
    
    textarea#foodDescription {
        min-height: 120px;
        font-size: 16px; /* Prevent iOS zoom on focus */
        padding: 0.75rem;
    }
    
    /* Fix textarea placeholder visibility */
    textarea#foodDescription::placeholder {
        color: var(--text-light);
        opacity: 0.7;
    }
    
    /* Ensure dark mode support for textarea */
    @media (prefers-color-scheme: dark) {
        textarea#foodDescription {
            background-color: var(--card-color);
            color: var(--text-color);
            border-color: var(--border-color);
        }
        
        textarea#foodDescription::placeholder {
            color: var(--text-light);
        }
    }
}

/* Fix for iOS form elements */
input, textarea, select, button {
    -webkit-appearance: none;
    appearance: none;
    border-radius: var(--border-radius-sm);
}
/* Definitive iOS form fixes */
input[type="text"],
input[type="email"],
input[type="number"],
input[type="password"],
textarea,
select {
    -webkit-appearance: none !important;
    appearance: none !important;
    -moz-appearance: none !important;
    appearance: none !important;
    border-radius: var(--border-radius-sm) !important;
}

/* iPhone-specific text area fixes */
@supports (-webkit-touch-callout: none) {
    textarea#foodDescription {
        padding: 12px;
        min-height: 120px !important;
        line-height: 1.4;
        border: 1px solid var(--border-color) !important;
        font-size: 16px !important; /* Prevents zoom */
        margin-bottom: 1rem !important;
        background-color: var(--card-color) !important;
        color: var(--text-color);
        display: block !important;
        width: 100% !important;
    }
    
    /* Specific description container styles for iOS */
    .description-container {
        display: flex;
        flex-direction: column;
    }
    
    .description-input-wrapper {
        flex: 1;
        display: flex;
        flex-direction: column;
    }
    
    /* Make button more touchable on iOS */
    #analyzeDescriptionButton {
        height: auto;
        min-height: 44px; /* Apple's recommended minimum touch target size */
        padding: 12px;
        border-radius: 0 0 var(--border-radius) var(--border-radius);
    }
}
/* Safari-specific fixes */
@supports (-webkit-touch-callout: none) and (not (-moz-appearance: none)) {
    /* Target Safari specifically by combining webkit support with absence of moz support */
    textarea#foodDescription {
        /* Reset to remove any browser-specific styling */
        -webkit-appearance: none;
        -webkit-border-radius: var(--border-radius-sm);
        border-radius: var(--border-radius-sm);
        background-color: var(--card-color);
        color: var(--text-color);
        
        /* Force dimensions */
        width: 100% !important;
        min-height: 120px !important;
        padding: 12px !important;
        
        /* Force border visibility */
        border: 1px solid var(--border-color) !important;
        
        /* Fix font rendering */
        font-size: 16px !important;
        line-height: 1.4 !important;
        font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, 
            Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif !important;
        
        /* Fix display mode */
        display: block !important;
        
        /* Fix box model */
        box-sizing: border-box !important;
        margin: 0 0 1rem 0 !important;
        
        /* Disable iOS styling */
        -webkit-appearance: none !important;
        appearance: none !important;
    }
    
    /* Fix Safari textarea focus */
    textarea#foodDescription:focus {
        outline: none !important;
        border-color: var(--primary-color) !important;
        box-shadow: 0 0 0 2px rgba(58, 134, 255, 0.2) !important;
    }
    
    /* Additionally, you might need to fix the container */
    .description-input-wrapper {
        padding: 0.75rem;
        margin: 0;
        display: block;
    }
    
    /* Fix placeholder text in Safari */
    textarea#foodDescription::placeholder {
        color: var(--text-light) !important;
        opacity: 1 !important;
        font-size: 16px !important;
    }
}


.safari-textarea {
    /* Apply styles directly to Safari textareas */
    -webkit-appearance: none !important;
    appearance: none !important;
    -moz-appearance: none !important;
    border: 1px solid #999 !important;
    border-radius: 0 !important;
    /* Add more overrides as needed */
}
/* Plant analysis specific colors */
:root {
    --plant-primary: #4caf50;
    --plant-primary-light: #81c784;
    --plant-primary-dark: #2e7d32;
    --plant-secondary: #8bc34a;
    --plant-accent: #ffd54f;
    --plant-warning: #ff9800;
    --plant-danger: #f44336;
}

/* Override the app theme colors for plant app */
.app-title h1, .logo span {
    background: linear-gradient(to right, #4caf50, #8bc34a);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.logo i {
    color: var(--plant-primary);
}

.btn-analyze {
    background-color: var(--plant-primary);
}

.btn-analyze:hover {
    background-color: var(--plant-primary-dark);
}

/* Custom plant-related section styles */
.plant-identification-section {
    border-left-color: var(--plant-primary) !important;
}

.plant-diagnosis-section {
    border-left-color: var(--plant-warning) !important;
}

.plant-care-section {
    border-left-color: var(--plant-secondary) !important; 
}

/* RTL support for plant sections */
[dir="rtl"] .plant-identification-section {
    border-right-color: var(--plant-primary) !important;
    border-left: none !important;
}

[dir="rtl"] .plant-diagnosis-section {
    border-right-color: var(--plant-warning) !important;
    border-left: none !important;
}

[dir="rtl"] .plant-care-section {
    border-right-color: var(--plant-secondary) !important;
    border-left: none !important;
}

/* Plant care special markers */
.sun-marker {
    display: inline-flex;
    align-items: center;
    background-color: rgba(255, 213, 79, 0.2);
    border-radius: 4px;
    padding: 0 4px;
    font-weight: 500;
    margin: 0 2px;
}

.sun-marker:before {
    content: "\f185";
    font-family: "Font Awesome 6 Free";
    font-weight: 900;
    margin-right: 4px;
    color: #ff9800;
}

.water-marker {
    display: inline-flex;
    align-items: center;
    background-color: rgba(3, 169, 244, 0.2);
    border-radius: 4px;
    padding: 0 4px;
    font-weight: 500;
    margin: 0 2px;
}

.water-marker:before {
    content: "\f043";
    font-family: "Font Awesome 6 Free";
    font-weight: 900;
    margin-right: 4px;
    color: #03a9f4;
}

/* RTL support for markers */
[dir="rtl"] .sun-marker:before,
[dir="rtl"] .water-marker:before {
    margin-right: 0;
    margin-left: 4px;
}

/* Enhanced upload container */
.upload-container {
    border-color: var(--plant-primary-light);
    background-color: rgba(76, 175, 80, 0.05);
}

.upload-container:hover {
    border-color: var(--plant-primary);
}

.upload-container .upload-icon {
    color: var(--plant-primary);
}

/* Plant analysis button styles */
.upload-option {
    border-color: var(--plant-primary-light);
}

.upload-option:hover {
    border-color: var(--plant-primary);
}

.upload-option i {
    color: var(--plant-primary);
}

/* Loading spinner */
.spinner {
    border-top-color: var(--plant-primary);
}

.loader-text {
    color: white;
}

/* Dark mode overrides for plant app */
@media (prefers-color-scheme: dark) {
    :root {
        --plant-primary: #66bb6a;
        --plant-primary-light: #81c784;
        --plant-primary-dark: #4caf50;
        --plant-secondary: #9ccc65;
        --plant-accent: #ffd54f;
    }
    
    .upload-container {
        background-color: rgba(76, 175, 80, 0.1);
    }
}