@import url('https://fonts.googleapis.com/css2?family=Noto+Sans+SC:wght@400;500;700&display=swap');

:root {
    --theme-dark: rgb(243, 152, 0);
    --theme-light: rgb(248, 182, 43);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Noto Sans SC', sans-serif;
    background-color: #f8f9fa;
    color: #333;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

main {
    flex-grow: 1;
    display: flex;
    justify-content: center;
    width: 100%;
}

.container {
    width: 100%;
    max-width: 600px;
    padding: 0 20px;
    margin-top: 14vh;
    margin-bottom: 5vh;
}

header {
    text-align: center;
    margin-bottom: 20px;
}

header h1 {
    font-size: 2.8rem;
    font-weight: 900;
    color: #333;
    margin-bottom: 64px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.title-icon {
    width: 1em; /* Make the icon size relative to the font size */
    height: 1em;
    margin-right: 15px;
}

header p {
    font-size: 1rem;
    color: #666;
}

.input-container {
    display: flex;
    align-items: center;
    background-color: var(--theme-light);
    border: 4px solid var(--theme-dark);
    border-radius: 12px;
    padding: 15px 20px;
    margin-bottom: 30px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.currency-symbol {
    color: white;
    font-size: 1.5rem;
    font-weight: 500;
    margin-right: 8px;
}

#amount-input {
    width: 100%;
    background: transparent;
    border: none;
    outline: none;
    color: white;
    font-size: 2.25rem;
    font-weight: 900;
    line-height: 1.2;
}

#amount-input::placeholder {
    color: rgba(255, 255, 255, 0.8);
    font-weight: 700;
    font-size: 1.5rem;
    line-height: 1;
    transform: translateY(-3px);
}

/* Hide number input arrows */
#amount-input::-webkit-outer-spin-button,
#amount-input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}
#amount-input[type=number] {
  -moz-appearance: textfield;
}

.title-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding: 0 5px;
}

.title-container h2 {
    font-size: 1.2rem;
    font-weight: 700;
    color: #555;
}

.filter-icon {
    width: 32px;
    height: 32px;
    background-color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
    transition: box-shadow 0.2s ease-in-out;
}

.filter-icon:hover {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
}

.item-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.item-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background-color: white;
    border-radius: 12px;
    padding: 15px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.item-info {
    display: flex;
    align-items: center;
}

.item-name {
    font-size: 1.1rem;
    font-weight: 500;
    color: #333;
}

.item-result {
    font-size: 1.1rem;
    font-weight: 700;
    color: #333;
}

.item-result .unit {
    font-size: 0.9rem;
    font-weight: 400;
    color: #777;
    margin-left: 4px;
}

.main-content {
    display: flex;
    flex-direction: row;
    gap: 30px;
    align-items: flex-start;
}

.input-wrapper {
    flex: 1;
    min-width: 300px;
    position: sticky;
    top: 20px;
}

.input-section {
    background: white;
    border-radius: 20px;
    padding: 30px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
}

.input-group {
    display: flex;
    flex-direction: column;
    gap: 15px;
    align-items: center;
}

.input-group label {
    font-size: 1.2rem;
    font-weight: 600;
    color: #333;
}

.input-group input {
    width: 100%;
    max-width: 300px;
    padding: 15px 20px;
    border: 2px solid #e1e5e9;
    border-radius: 10px;
    font-size: 1.1rem;
    transition: all 0.3s ease;
}

.input-group input:focus {
    outline: none;
    border-color: var(--theme-dark);
    box-shadow: 0 0 0 3px rgba(243, 152, 0, 0.2);
}

.input-group button {
    background: linear-gradient(135deg, var(--theme-light) 0%, var(--theme-dark) 100%);
    color: white;
    border: none;
    padding: 15px 30px;
    border-radius: 10px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 5px 15px rgba(243, 152, 0, 0.3);
}

.input-group button:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(243, 152, 0, 0.4);
}

.products-section {
    flex: 2;
    background: white;
    border-radius: 20px;
    padding: 30px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
}

.products-section h2 {
    text-align: center;
    margin-bottom: 30px;
    color: #333;
    font-size: 2rem;
}

.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 15px;
}

.product-card {
    background: #f8f9fa;
    border-radius: 15px;
    padding: 20px;
    transition: all 0.3s ease;
    border: 2px solid transparent;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.product-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(0,0,0,0.1);
    border-color: var(--theme-dark);
}

.product-card.affordable {
    background: linear-gradient(135deg, #fff9e6 0%, #fff2d4 100%);
    border-color: var(--theme-dark);
}

.product-card.not-affordable {
    opacity: 0.6;
    background: #f5f5f5;
    border-color: #ccc;
}

.product-info {
    display: flex;
    align-items: center;
    gap: 15px;
}

.product-icon {
    font-size: 2.5rem;
}

.product-name {
    font-size: 1.1rem;
    font-weight: 600;
    color: #333;
}

.product-quantity {
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--theme-dark);
    padding: 8px 12px;
    background: rgba(243, 152, 0, 0.1);
    border-radius: 15px;
    min-width: 60px;
    text-align: center;
}

.product-quantity.not-affordable {
    color: #999;
    background: rgba(153, 153, 153, 0.1);
}

footer {
    width: 100%;
    text-align: center;
    padding: 20px 0;
    margin-top: 40px;
    font-size: 0.9rem;
    color: #aaa;
}

@media (max-width: 992px) {
    .main-content {
        flex-direction: column;
    }
    .input-wrapper {
        width: 100%;
        position: static;
    }
}

@media (max-width: 768px) {
    
    .input-section {
        padding: 20px;
    }
    
    .products-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }
    
    .product-card {
        padding: 15px;
    }
    
    .product-icon {
        font-size: 2rem;
    }
    
    .product-name {
        font-size: 1rem;
    }
    
    .product-quantity {
        font-size: 1.1rem;
        padding: 6px 10px;
    }
}

@media (max-width: 480px) {
    .product-info {
        gap: 10px;
    }
    
    .product-icon {
        font-size: 1.8rem;
    }
    
    .product-name {
        font-size: 0.9rem;
    }
}

@media (min-width: 600px) {
    .item-list {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 15px;
    }
}

a {
    color: #333;
    text-decoration: none;
    transition: color 0.2s;
}
a:hover {
    color: var(--theme-dark);
    text-decoration: underline;
}
a:visited,
a:active,
a:focus {
    color: #333;
    text-decoration: none;
}