/* style.css */
@import "tailwindcss";

body {
    font-family: 'Open Sans', sans-serif;
    font-optical-sizing: auto;
    font-style: normal;
    margin: 0;
    padding: 0;
    background-color: #f4f4f4;
    /* Light background */
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
}

::placeholder {
    font-family: 'Open Sans', sans-serif;
    /* Add other styles as needed */
}

.container {
    position: relative;
    background-color: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    width: 400px;
    min-height: 680px;
}

h1 {
    text-align: center;
    color: #333;
}

.tabs {
    display: flex;
    margin-bottom: 0px;
    position: relative;
}

.tab {
    padding: 10px 15px;
    border: none;
    background-color: #d8d8d8;
    color: #333;
    cursor: pointer;
    border-radius: 5px 5px 0 0;
    margin-right: 5px;
}

.tab.active {
    background-color: #eee;
}

.tab-content {
    position: relative;
    padding: 20px;
    border: 1px solid #ddd;
    border-top: none;
    border-radius: 0 0 5px 5px;
    min-height: 620px;
}

.tab-panel {
    position: relative;
}

.tab-info-icon {
    position: absolute;
    width: 24px;
    height: 24px;
    top: 5px;
    right: 5px;
    cursor: pointer;
    font-size: 10px;
    color: #8c8c8c;
}

.tab-back {
    display: none;
}

.tab-content.flipped .tab-front {
    display: none;
}

.tab-content.flipped .tab-back {
    display: block;
}

.tab-info-icon {
    position: absolute;
    top: 5px;
    /* Adjust as needed */
    right: 5px;
    /* Adjust as needed */
    cursor: pointer;
    font-size: 14px;
    /* Adjust as needed */
    color: #a4a4a4;
    /* Adjust as needed */
}

.tab-info-icon:hover {
    color: #777
}

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

input[type="text"],
input[type="number"] {
    width: 100%;
    padding: 8px;
    margin-bottom: 10px;
    border: 1px solid #ccc;
    border-radius: 4px;
    box-sizing: border-box;
}

button {
    background-color: #4CAF50;
    /* Green button */
    color: white;
    padding: 10px 15px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
}

.remove-button {
    padding: 10px 10px;
    height: 34px;
    display: flex;
    align-items: center;
    justify-content: center;
}

button:hover {
    background-color: #45a049;
    /* Darker green on hover */
}

#percentageResult,
#flourProteinResult {
    margin-top: 10px;
    /* font-weight: bold; */
}

.ingredient-row {
    display: flex;
    margin-bottom: 10px;
}

.flour {
    width: 60%;
    margin-right: 5px;
}

.ingredient-row input[type="text"] {
    width: 60%;
    /* Adjust as needed */
    margin-right: 5px;
}

.ingredient-row input[type="number"] {
    width: 40%;
    /* Adjust as needed */
    margin-right: 5px;
}

#gramsResult {
    margin-top: 10px;
    overflow-x: auto;
    /* Add horizontal scroll if needed */
    white-space: nowrap;
    /* Prevent wrapping */
    font-weight: bold;
}

#gramsResult span {
    display: inline-block;
    min-width: 100px;
}

.table {
    padding: 8px;
    border-bottom: 1px solid #ddd;
}

.unbold {
    font-weight: normal;
}

footer {
    text-align: center;
    margin-top: 5px;
    margin-bottom: -12px;
}

footer i {
    font-size: 20px;
    text-decoration: none;
    color: #a4a4a4;
}

footer i:hover {
    color: #2f2f2f
}

.dark-mode-toggle {
    position: absolute;
    top: 10px;
    right: 10px;
    z-index: 10;
}

/* Dark Mode Styles */
.dark-mode {
    background-color: #121212;
    color: #ffffff;
}

.dark-mode .container {
    background-color: #1e1e1e;
    box-shadow: 0 2px 5px rgba(255, 255, 255, 0.1);
}

.dark-mode h1,
.dark-mode h2,
.dark-mode label {
    color: #ffffff;
}

.dark-mode input[type="text"],
.dark-mode input[type="number"] {
    background-color: #2e2e2e;
    color: #ffffff;
    border: 1px solid #555;
}

.dark-mode input::placeholder {
    color: #bbbbbb;
}

.dark-mode button {
    background-color: #4CAF50;
}

.dark-mode .tab {
    background-color: #333;
    color: #fff;
}

.dark-mode .tab.active {
    background-color: #444;
}

.dark-mode .tab-info-icon {
    color: #cccccc;
}

.dark-mode .tab-info-icon:hover {
    color: #ffffff;
}

.dark-mode button:hover {
    background-color: #45a049;
    /* Darker green on hover */
}

.dark-mode .tab-content {
    border-color: #555;
}

.dark-mode .remove-button {
    background-color: #333;
    color: #fff;
}

.dark-mode footer i:hover {
    color: #ffffff;
}


/* Toggle Switch */
.switch {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 24px;
}

/* Hide default checkbox */
.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

/* The slider (background) */
.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: 0.3s;
    border-radius: 24px;
}

/* The slider circle (toggle button) */
.slider:before {
    position: absolute;
    content: "";
    height: 20px;
    width: 20px;
    left: 3px;
    bottom: 2px;
    background-color: white;
    transition: 0.3s;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
}

/* Icons inside the toggle circle */
.slider .dark-icon,
.slider .light-icon {
    position: absolute;
    font-size: 12px;
    transition: opacity 0.15s ease-in-out;
}

/* Default: show moon icon inside the toggle circle */
.slider .dark-icon {
    left: 35px;
    top: 6px;
    color: black;
    opacity: 0;
}

/* Hide sun icon by default */
.slider .light-icon {
    left: 7px;
    top: 6px;
    color: black;
}

/* Move the slider circle when toggled */
input:checked+.slider:before {
    transform: translateX(26px);
}

/* Toggle icon switch */
input:checked+.slider .dark-icon {
    opacity: 1;
}

input:checked+.slider .light-icon {
    opacity: 0;
}