
body {
    font-family: 'Arial', sans-serif;
    background-color: #f8f8f8;
    margin: 0;
    padding: 0;
    min-height: 100vh;
}


header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: rgba(51, 51, 51, 0.95);
    color: #fff;
    padding: 15px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 1000;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}

.logo {
    font-size: 28px;
    font-weight: bold;
    color: #ff9800;
    letter-spacing: 1px;
}

nav {
    flex: 1;
    text-align: center;
}

nav ul {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    align-items: center;
}

nav ul li {
    margin: 0 15px;
}

.home-link {
    color: #fff;
    font-size: 20px;
    transition: color 0.3s ease;
    display: flex;
    align-items: center;
}

.home-link:hover {
    color: #ff9800;
}

.nav-right {
    display: flex;
    align-items: center;
}


.profile-btn {
    color: #fff;
    font-size: 24px;
    transition: color 0.3s ease;
}

.profile-btn:hover {
    color: #ff9800;
}

.find-recipe {
    margin-right: 20px;
}

.find-recipe-btn {
    display: flex;
    align-items: center;
    color: #fff;
    text-decoration: none;
    font-size: 16px;
    transition: color 0.3s;
}

.find-recipe-btn i {
    font-size: 18px;
    margin-right: 5px;
}

.find-recipe-btn:hover {
    color: #ff9800;
}


.hero-section {
    height: 40vh;
    background: linear-gradient(rgba(0, 0, 0, 0.6), rgba(0, 0, 0, 0.6)), url('https://img.freepik.com/free-photo/top-view-flour-with-baking-tools-table_23-2148461115.jpg?t=st=1741690288~exp=1741693888~hmac=483835e447cadf2d0dec37961f84a9135a8fdb5f0e326697605358c748efaef8&w=2000') no-repeat center center/cover;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    color: white;
    text-align: center;
    position: relative;
    padding-top: 60px;
}

.hero-content {
    max-width: 800px;
    margin-bottom: 40px;
    animation: fadeInDown 1s ease-out forwards;
}

.hero-content h1 {
    font-size: 48px;
    margin-bottom: 20px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
}

.hero-content p {
    font-size: 20px;
    margin-bottom: 30px;
    text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.5);
}


.main-content {
    padding-top: 60px;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

.converter-wrapper {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 20px;
    flex-wrap: wrap;
    margin-top: 40px;
}

.box {
    background: white;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    min-width: 400px;
    min-height: 500px;
}

.input-box {
    flex: 1;
}

.output-box {
    flex: 1;
}

.conversion-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 10px;
}

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

.conversion-table th {
    background-color: #ff9800;
    color: white;
    font-weight: 600;
}

.conversion-table td {
    background-color: white;
}

.conversion-table tbody tr:hover {
    background-color: #f5f5f5;
}

.convert-button {
    background-color: #ff9800;
    color: white;
    border: none;
    padding: 15px 30px;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 20px 0;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.convert-button:hover {
    background-color: #f57c00;
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.15);
}

.convert-button:active {
    transform: translateY(0);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.convert-button i {
    font-size: 18px;
}

.grams-title {
    text-align: center;
    color: white;
    margin-bottom: 20px;
    font-size: 24px;
    font-weight: 600;
    background-color: #ff9800;
    padding: 10px;
    border-radius: 4px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.gram-results {
    padding: 20px;
    min-height: 100px;
}

.gram-results table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 10px;
}

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

.gram-results table th {
    background-color: #ff9800;
    color: white;
    font-weight: bold;
}

.gram-results table tr:nth-child(even) {
    background-color: #f9f9f9;
}

.gram-results table tr:hover {
    background-color: #f5f5f5;
}

.no-results {
    color: #757575;
    text-align: center;
    font-style: italic;
    padding: 20px;
}

.form-select {
    width: 100%;
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
    background-color: white;
    font-size: 14px;
}

.form-select:focus {
    border-color: #ff9800;
    outline: none;
    box-shadow: 0 0 0 2px rgba(255, 152, 0, 0.2);
}

.form-select:hover {
    border-color: #ff9800;
}


.select-container {
    position: relative;
    width: 100%;
}

.dropdown-search {
    width: 100%;
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 4px 4px 0 0;
    font-size: 14px;
    margin-bottom: -1px;
    background-color: #fff;
    border-bottom: 1px solid #ff9800;
}

.dropdown-search:focus {
    outline: none;
    border-color: #ff9800;
    box-shadow: 0 0 0 2px rgba(255, 152, 0, 0.2);
}

.select-container .form-select {
    border-radius: 0 0 4px 4px;
    transition: all 0.3s ease;
}


.selected-by-enter {
    background-color: #fff3e0;
    border-color: #ff9800;
    box-shadow: 0 0 0 2px rgba(255, 152, 0, 0.3);
    animation: pulse-orange 0.5s ease;
}

@keyframes pulse-orange {
    0% {
        box-shadow: 0 0 0 0 rgba(255, 152, 0, 0.7);
    }
    70% {
        box-shadow: 0 0 0 10px rgba(255, 152, 0, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(255, 152, 0, 0);
    }
}


@media (max-width: 1200px) {
    .box {
        min-width: 300px;
    }
}

@media (max-width: 768px) {
    .converter-wrapper {
        flex-direction: column;
    }
    
    .box {
        width: 100%;
        min-width: unset;
    }
    
    .convert-button {
        width: 100%;
        justify-content: center;
    }
}


footer {
    background-color: #333;
    color: white;
    text-align: center;
    padding: 20px;
    margin-top: 40px;
}

.footer-content {
    max-width: 1200px;
    margin: 0 auto;
}


@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.conversion-table th,
.gram-results th {
    background-color: #ff9800;
    color: white;
    font-weight: 600;
}

.gram-results table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 10px;
}

.gram-results td,
.gram-results th {
    border: 1px solid #ddd;
    padding: 12px;
    text-align: left;
}

.gram-results tbody tr:hover {
    background-color: #f5f5f5;
}


.quantity-cell {
    background-color: #f8f8f8;
    cursor: text;
    transition: all 0.2s;
    position: relative;
}

.quantity-cell:focus {
    background-color: #fff3e0;
    box-shadow: inset 0 0 0 2px #ff9800;
    outline: none;
}

.quantity-cell:empty::before {
    content: "Enter number";
    color: #999;
    font-style: italic;
    position: absolute;
}

.quantity-cell:hover:not(:focus) {
    background-color: #f0f0f0;
}


.dropdown-search:focus,
.form-select:focus,
.quantity-cell:focus,
.convert-button:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(255, 152, 0, 0.4);
    border-color: #ff9800;
    transition: all 0.2s ease;
}

.convert-button:focus {
    transform: translateY(-2px);
}


@keyframes pulse-arrow {
    0% { opacity: 0.5; }
    50% { opacity: 1; }
    100% { opacity: 0.5; }
}

.quantity-cell:focus::after,
.dropdown-search:focus::after {
    content: "↵";
    position: absolute;
    right: 8px;
    color: #ff9800;
    font-weight: bold;
    animation: pulse-arrow 1s infinite;
}
