body {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
  overflow-y: scroll;
  -webkit-overflow-scrolling: touch;
  text-rendering: optimizeLegibility;
  -webkit-text-size-adjust: 100%;
  -ms-text-size-adjust: 100%;
  -moz-text-size-adjust: 100%;
}

#open-food-facts-container {
    margin-top: 30px;
    padding: 15px;
    border-radius: 15px;
    box-shadow: 0px 10px 30px 20px rgba(0, 0, 0, 0.1);
    background-image: url(https://m.media-amazon.com/images/I/7140Q+2moLL._AC_UF894,1000_QL80_.jpg);
    background-repeat: no-repeat;
    background-size: cover;
    background-position: center;
}

#open-food-facts-search-form {
  margin-top: 30px;
}

#open-food-facts-barcode-input,
#open-food-facts-product-input,
#open-food-facts-ingredient-input,
#open-food-facts-search-form button {
  height: 60px;
  border-radius: 10px;
  border: none;
}

#open-food-facts-search-form button {
  margin-top: 15px;
  background-color: #007BFF;
  color: white;
}

#open-food-facts-search-form button:hover {
  background-color: #0056b3;
}

#open-food-facts-nutrition-results {
  color: #000000;
  background-color: white;
  padding: 20px;
  margin-top: 30px;
  border-radius: 10px;
}

#open-food-facts-nutrition-results p {
  margin-bottom: 20px;
}

#scanner-container {
    position: relative;
    top: 0;
    left: 0;
    width: 100%;
    height: 400px; /* Set a fixed height or base it on the aspect ratio of the camera feed */
    background: #000; /* Optional: Makes it easier to see the video feed area */
}

#scanner-container video,
#scanner-container canvas {
  position: relative;
  top: 0;
  left: 0;
  width: 100%;
  height: auto;
  max-height: 400px;
}

#scanner-container .viewport:after {
    content: ' ';
    display: block;
    position: absolute;
    top: 50%;
    left: 50%;
    width: 300px;
    height: 300px;
    margin-left: -150px; /* half the width to center it */
    margin-top: -150px;  /* half the height to center it */
    border: solid 3px red;
    border-radius: 50%;
}

#scanner-target-overlay {
    display: none; /* Change to block to make it visible by default */
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 300px; /* Adjust as needed */
    height: 100px; /* Adjust as needed */
    border: 2px solid red;
    pointer-events: none; /* Ensures that clicks pass through the overlay */
    z-index: 1050;
}

.highlight {
  background-color: yellow;
}

.beautiful-box {
  padding: 20px;
  border: 1px solid #ccc;
  border-radius: 5px;
  margin-bottom: 20px;
  height: auto;
}

.title {
  font-size: 20px;
  font-weight: bold;
  margin-bottom: 10px;
}

.nutrition-table {
  width: 100%;
  height: auto;
}

.nutrition-table td {
  padding: 5px 10px;
}

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

.formatted-line {
  font-family: Arial, sans-serif;
  font-size: 14px;
  line-height: 1.5;
  margin-bottom: 10px;
  white-space: pre-wrap;
}

.loading-message-container {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  font-weight: bold;
  margin-bottom: 20px;
  position: relative;
}

.loading-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  background-color: #000;
  border-radius: 50%;
  margin-right: 4px;
  animation: loadingAnimation 1s infinite;
}

@keyframes loadingAnimation {
  0%, 80%, 100% {
    transform: scale(0.5);
  }
  40% {
    transform: scale(1);
  }
}

#loading-message {
  display: none;
}

.drag-drop-area {
    border: 2px dashed #ccc;
    border-radius: 5px;
    padding: 20px;
    text-align: center;
    cursor: pointer;
    color: #2c2828;
    margin-bottom: 20px;
}

.drag-drop-area:hover {
    background-color: #f9f9f9;
    color: #333;
}

/* Accordion Styles */
.accordion-item {
    border-bottom: 1px solid #ddd;
    padding: 10px;
    background-color: #f9f9f9;
}

.accordion-button {
    background-color: #007bff;
    color: white;
    padding: 10px 15px;
    text-align: left;
    border: none;
    outline: none;
    width: 100%;
    text-transform: uppercase;
    font-weight: bold;
    cursor: pointer;
}

.accordion-button:hover {
    background-color: #0056b3;
}

.panel {
    padding: 0;
    display: none;
}

.panel.show {
    display: block;
}

/* Nutrition Table Styles */
.nutrition-table {
    width: 100%;
    margin-top: 15px;
    border-collapse: collapse;
    background-color: white;
}

.nutrition-table th, .nutrition-table td {
    padding: 8px;
    border: 1px solid #ddd;
    text-align: left;
}

.nutrition-table th {
    background-color: #007bff;
    color: white;
}

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

/* Chart Styles */
#nutrition-chart {
    max-width: 400px;
    margin: 20px auto;
    max-height: 200px !important;
}

/* Score Styles */
tr[style*="background-color:yellow;"] {
    background-color: #ffecb3 !important;
}

/* General Styles */
strong {
    color: #007bff;
}

.card-img-top {
    width: 100px;
    height: 200px;
}

.nutrition-tracker {
    margin-top: 20px;
    padding: 15px;
    background-color: #f7f7f7;
    border-radius: 8px;
}

.tracker-item {
    padding: 10px;
    border-bottom: 1px solid #ddd;
}

.tracker-totals {
    padding: 10px;
    background-color: #e9ecef;
    font-weight: bold;
}

.add-button {
    margin-top: 10px;
    padding: 5px 10px;
    background-color: #28a745;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
}

.add-button:hover {
    background-color: #218838;
}

.remove-button {
    margin-left: 10px;
    padding: 2px 6px;
    background-color: #dc3545;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
}

.remove-button:hover {
    background-color: #c82333;
}

/* gi-gl-style.css */

/* Container for the Glycemic Info */
#gi-gl-container {
    background-color: #f9f9f9; /* Light grey background */
    border: 1px solid #ddd; /* Light grey border */
    padding: 20px; /* Padding around the content */
    border-radius: 5px; /* Rounded corners */
    margin-top: 20px; /* Space above the container */
}

/* Title for the Glycemic Info section */
#gi-gl-container h3 {
    color: #333; /* Dark grey color */
    margin-bottom: 15px; /* Space below the title */
}

/* Paragraphs within the Glycemic Info section */
#gi-gl-container p {
    color: #666; /* Medium grey color */
    line-height: 1.6; /* Spacing between lines */
}

/* Canvas for the Chart.js chart */
#gi-gl-chart {
    max-width: 100%; /* Ensure it doesn't overflow its container */
    margin-top: 20px; /* Space above the chart */
    max-height: 200px;
}

/* Specific styles for the Good Choice, Just OK, and Avoid labels */
.good-choice {
    color: #28a745; /* Green color */
}

.just-ok {
    color: #ffc107; /* Yellow color */
}

.avoid {
    color: #dc3545; /* Red color */
}

table {
    width: 100%;
    border-collapse: collapse;
}

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

th {
    background-color: #f2f2f2;
}

tr:nth-child(even) {
    background-color: #f9f9f9;
}

tr:hover {
    background-color: #f1f1f1;
}

/* Style for the drawer toggle button */
.toggle-drawer {
    position: fixed;
    top: 50%;
    right: 0;
    transform: translateY(-50%);
    z-index: 1051;
    transition: right 0.3s ease;
    cursor: pointer;
}

/* Style for the drawer container */
.drawer-container {
    position: fixed;
    top: 0;
    right: -500px; /* Initially off-screen */
    height: 100%;
    width: 500px; /* Static width for larger screens */
    background-color: #fff;
    box-shadow: -2px 0 5px rgba(0, 0, 0, 0.5);
    transition: right 0.3s ease;
    overflow-y: auto;
    z-index: 1050;
}

/* Small screens adjustments */
@media (max-width: 768px) {
    .drawer-container {
        width: 80%; /* Dynamic width for smaller screens */
        right: -80%; /* Adjusted off-screen position */
    }
}

/* When the drawer is active/open */
.drawer-active {
    right: 0; /* Bring into view */
}

/* Adjust toggle button position when the drawer is open */
body.drawer-is-open .toggle-drawer {
    right: calc(500px); /* For larger screens */
}

@media (max-width: 768px) {
    /* Adjust for small screens when the drawer is open */
    body.drawer-is-open .toggle-drawer {
        right: calc(80%); /* Align with the drawer's width */
    }
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #f0f4f8;
    color: #333;
    margin: 0;
    padding: 0;
    line-height: 1.5;
    overflow: auto;
}

.page {
    max-width: 100%; /* Make it use full width on smaller screens */
    margin: 20px auto;
    padding: 20px;
    background: #f0f0f0;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    overflow: auto;
}

h1 {
    color: #007bff;
    text-align: center;
    margin-bottom: 30px;
    font-size: 1.5em; /* Responsive font size */
}

fieldset {
    border: 1px solid #e2e2e2;
    padding: 20px;
    margin-bottom: 20px;
    border-radius: 5px;
    background: linear-gradient(145deg, #ffffff, #f6f6f6);
}

legend {
    width: auto;
    padding: 0 10px;
    font-weight: bold;
    color: #333;
    font-size: 1.1em;
}

label {
    display: block;
    margin-bottom: 5px;
    font-weight: 600;
}

input[type="text"], textarea {
    width: 100%;
    padding: 10px;
    margin-bottom: 15px;
    border: 1px solid #ddd;
    border-radius: 4px;
    box-sizing: border-box;
    transition: border-color 0.3s;
}

input[type="text"]:focus, textarea:focus {
    border-color: #007bff;
}

.btn {
    background: #007bff;
    color: #fff;
    padding: 10px 20px;
    text-decoration: none;
    border: none;
    border-radius: 20px;
    cursor: pointer;
    margin-bottom: 10px; /* Add space between buttons */
    transition: background 0.3s ease;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    display: block; /* Make buttons take full width */
    width: 100%;
}

.btn:hover {
    background: #0056b3;
}

.js-output, .js-detailed-info {
    transition: all 0.5s ease-in-out;
    overflow: hidden;
    padding: 0 20px;
}

.js-output.show, .js-detailed-info.show, .ai-response-container {
    max-height: 1000px;
    padding: 20px;
}

.ai-response-container {
    margin-top: 20px;
    background: #f9f9f9;
    padding: 10px;
    border-radius: 5px;
    height: 100px;
    margin-bottom: 200px;
}

#aiResponse {
    min-height: 200px; /* Adjust this value as needed */
    width: 100%; /* Ensure it takes the full width */
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    box-sizing: border-box;
}

@media (max-width: 768px) {
    .page {
        padding: 10px;
    }

    h1 {
        font-size: 1.2em; /* Smaller font size for smaller screens */
    }

    .btn {
        margin-right: 0; /* Remove margin between buttons */
        margin-bottom: 10px; /* Add some space below each button */
    }

    input[type="text"], textarea {
        font-size: 1em; /* Larger font size for better readability */
    }
}

/* Style the accordion */
.accordion2 {
    background-color: #eee;
    color: #444;
    cursor: pointer;
    padding: 18px;
    width: 100%;
    border: none;
    text-align: left;
    outline: none;
    font-size: 15px;
    transition: 0.4s;
}

/* Add a background color to the button if it is clicked on (add the .active class with JS) */
.accordion2.active, .accordion2:hover {
    background-color: #ccc;
}

/* Style the accordion panel. Note: hidden by default */
.panel2 {
    padding: 0 18px;
    background-color: white;
    display: none;
    overflow: hidden;
}

/* Βασικές Ρυθμίσεις */
html, body {
    font-family: 'Open Sans', sans-serif;
    margin: 0;
    padding: 0;
    background: #f4f4f4;
    color: #333;
}

h1, h2, h3 {
    color: #673774;
}

/* Στυλισμός των Φορμών και των Στοιχείων */
.wrapper, #ingredientsInputs {
    max-width: 800px;
    margin: 20px auto;
    padding: 20px;
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.question, .ingredient-row {
    margin-bottom: 15px;
}

label {
    display: block;
    margin-bottom: 5px;
    font-weight: bold;
}

input[type="button"] {
    background-color: #673774;
    color: white;
    padding: 10px 20px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.3s;
}

input[type="button"]:hover {
    background-color: #572a60;
}

input[type="text"], input[type="number"] {
    width: 100%;
    padding: 10px;
    margin-bottom: 10px;
    border: 1px solid #1a1818;
    border-radius: 4px;
    background: rgb(227 226 239 / 50%);
    box-sizing: border-box;
    color: #333;
}

.shepherd-theme-dark {
    background-color: rgba(51, 51, 51, 0.9); /* Semi-transparent grey */
    color: #fff;
    border-radius: 4px;
    padding: 10px;
}

.shepherd-theme-dark .shepherd-header {
    background-color: rgba(68, 68, 68, 0.9); /* Semi-transparent darker grey */
    color: #fff;
    padding: 10px;
    border-bottom: 1px solid #555;
}

.shepherd-theme-dark .shepherd-footer {
    background-color: rgba(68, 68, 68, 0.9); /* Semi-transparent darker grey */
    color: #fff;
    padding: 10px;
    border-top: 1px solid #555;
}

.shepherd-theme-dark .shepherd-button {
    background-color: #007bff;
    color: #fff;
    border: none;
    border-radius: 4px;
    padding: 5px 10px;
    margin: 0 5px;
    cursor: pointer;
}

.shepherd-theme-dark .shepherd-button:hover {
    background-color: #0056b3;
}

.shepherd-theme-dark .shepherd-cancel-icon {
    color: #fff;
}

.shepherd-theme-dark .shepherd-arrow {
    border-color: rgba(51, 51, 51, 0.9); /* Match the tooltip background */
}

.shepherd-highlight {
    box-shadow: 0 0 0 5px rgba(255, 0, 0, 0.8) !important; /* Red color with 80% opacity */
    border: 1px solid red !important; /* Thinner red border */
    background-color: rgba(255, 255, 0, 0.5) !important; /* Light yellow background with 50% opacity */
    position: relative;
    z-index: 1000;
}
/* Responsive Table */

/* Responsive Table for Panels - List Layout */
@media (max-width: 768px) {
    .panel table {
        width: 100%;
        display: block;
    }

    .panel table thead {
        display: none; /* Hide the table header */
    }

    .panel table tbody {
        display: block;
    }

    .panel table tr {
        display: block;
        margin-bottom: 10px;
        border-bottom: 1px solid #ddd;
        padding-bottom: 10px;
    }

    .panel table td {
        display: block;
        padding: 5px 0;
        text-align: left;
    }

    .panel table td:nth-child(2)::before,
    .panel table td:nth-child(3)::before {
        content: "";
        padding-right: 0;
    }

    .panel table tr:last-child {
        border-bottom: none;
        padding-bottom: 0;
    }

    .panel caption {
        font-weight: bold;
        text-align: center;
        margin-bottom: 15px;
        display: block;
    }

    .panel canvas {
        max-width: 100%;
        height: auto;
    }
}
