@import url('https://fonts.googleapis.com/css2?family=Montserrat:ital,wght@0,100..900;1,100..900&display=swap');
:root {
    --primary-color: #2ecc71;
    --secondary-color: #27ae60;
    --background-color: #f8f9fa;
    --card-background: #ffffff;
    --text-color: #2c3e50;
    --border-radius: 10px;
    --shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}
*{font-family: "Montserrat", sans-serif !important;}
body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: var(--background-color);
    color: var(--text-color);
    line-height: 1.6;
}

.container {
    max-width: 1600px; /* Increased from 1200px */
    margin: 0 auto;
    padding: 2rem;
}

header {
    text-align: center;
    margin-bottom: 3rem;
}

header h1 {
    color: var(--primary-color);
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
}

.subtitle {
    color: #666;
    font-size: 1.1rem;
}

.card-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 2rem;
    padding: 1rem;
    max-width: 100%;
    margin: 0 auto;
}
.card-grid > :first-child {
    grid-column: span 2;
}
.card-header p {
    color: #fff;
    background: #2ecc71
;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}
.card-header h2 {
    display: flex;
    gap: 10px;
    align-items: center;
}
.card {
    background: var(--card-background);
    border-radius: 15px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    overflow: hidden;
    transition: all 0.3s ease;
    min-height: fit-content;
    width: 100%;
    padding: 25px;
}

.card:hover {
    transform: translateY(-5px);
}

.card-header {
    /* background: linear-gradient(135deg, var(--primary-color), var(--secondary-color)); */
    padding: 1.2rem 1.5rem;
}

.card-header h2 {
    font-size: 1.2rem;
    margin: 0;
}

.card-content {
    padding: 2rem;
    min-height: 231px;
 
}

/* Improve form elements spacing */
.input-group {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1rem;
    margin-bottom: 3.5rem;
}

input[type="text"] {
    padding: 1rem;
    border: 2px solid #6cd3a8;
    border-radius: 8px;
    font-size: 1rem;
    transition: border-color 0.2s;
}

input[type="text"]:focus {
    border-color: var(--primary-color);
    outline: none;
}

.file-input-wrapper {
    margin: 1.5rem 0;
}

.file-label {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.2rem;
    background: #f8fafc;
    border: 2px dashed #6cd3a8;
    border-radius: 10px;
    cursor: pointer;
    font-weight: 500;
}

.file-label:hover {
    border-color: var(--primary-color);
    background: #f0f9f4;
}

input[type="file"] {
    display: none;
}

button {
    width: 100%;
    padding: 1rem;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 500;
    transition: background 0.3s;
}

button:hover {
    background: var(--secondary-color);
}
body .card-header {
    display: flex;
    align-items: center;
    gap: 10px;
    color: #333;
    /* background: linear-gradient(135deg, #1b663b, var(--secondary-color)); */
    padding: 8px 15px;
    font-weight: 700;
}
.card-header h2 {
    font-size: 18px;
    font-weight: 700;
}
table.nutrition-table {
  border-collapse: collapse;
  width: 100%;
}

table.nutrition-table td, table.nutrition-table th {
  border: 2px solid #ddd;
  padding: 8px;
}

table.nutrition-table tr:nth-child(even){background-color: #f2f2f2;}



table.nutrition-table th {
  padding-top: 12px;
  padding-bottom: 12px;
  text-align: left;
  background-color: #2ecc71;
  color:#fff;
}
.result-box {
    padding: 2rem;
    background: #fff;
    border-radius: 10px;
    /* box-shadow: 0 2px 8px rgba(0,0,0,0.1); */
    opacity: 0;
    transition: opacity 0.3s ease;
}
section.card button {
    /* background: #333; */
    padding: 15px 10px;
}
.nutrition-dashboard {
    display: flex;
    flex-wrap: wrap;
}
 
.loading-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 5px solid #f3f3f3;
    border-top: 5px solid var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

footer {
    text-align: center;
    padding: 2rem;
    color: #666;
}

.image-preview {
    max-width: 100%;
    height: 200px;
    margin: 10px auto;
    border-radius: 8px;
    display: none;
    object-fit: contain;
    background: #f8f9fa;
    border: 2px solid #edf2f7;
    padding: 8px;
}

.result-card {
    background: white;
    border-radius: 5px;
    padding: 15px;
    margin-top: 15px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.result-card h3 {
    color: var(--primary-color);
    margin-bottom: 10px;
    font-size: 1.1rem;
}

.result-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
}

.result-item {
    display: flex;
    justify-content: space-between;
    padding: 5px 0;
    border-bottom: 1px solid #eee;
}

.result-label {
    color: #666;
    font-weight: 500;
}

.result-value {
    font-weight: 600;
}

.file-input-container {
    margin-top: 1rem;
    text-align: center;
}

.selected-filename {
    margin-top: 0.5rem;
    font-size: 0.9rem;
    color: #666;
    word-break: break-all;
}

.error-box {
    background-color: #fee2e2;
    border: 1px solid #ef4444;
    border-radius: 8px;
    padding: 1rem;
    margin: 1rem 0;
    color: #991b1b;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.error-box i {
    color: #dc2626;
}

@media (max-width: 768px) {
    .container {
        padding: 1rem;
    }
    
    .card-grid {
        grid-template-columns: 1fr;
    }
}



/* new css */

.food-form-result-container {
    display: flex;
    gap: 20px;
}

.food-form-result-container.show-result {
border: 1px solid #3333;
min-height: 250px;
border-radius: 20px;
flex: 50%;

}
.card-content,
.result-box {
 flex: 50%;
 border: 1px solid #3333;
 border-radius: 20px;
}

.camera-button {
    background: var(--primary-color);
    color: white;
    padding: 0.5rem 1rem;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    margin: 0.5rem 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    z-index: 1000;
}

.modal-content {
    position: relative;
    width: 90%;
    max-width: 600px;
    margin: 2rem auto;
    background: white;
    padding: 1rem;
    border-radius: 10px;
}

.close-modal {
    position: absolute;
    right: 1rem;
    top: 0.5rem;
    font-size: 1.5rem;
    cursor: pointer;
}

#camera-preview {
    width: 100%;
    max-height: 70vh;
    object-fit: cover;
    margin-bottom: 1rem;
}

.camera-controls {
    display: flex;
    gap: 1rem;
    justify-content: center;
    margin-top: 1rem;
}

.input-buttons {
    display: flex;
    gap: 1rem;
    margin-bottom: 1rem;
}

.camera-button i {
    font-size: 1.2rem;
}