* {
    box-sizing: border-box;
}


.container {
    background: white;
    border-radius: 20px;
    padding: 0 10px;
    max-width: 400px;
    width: 100%;
    height: 390px;
    overflow-y: hidden;
    margin: 0 auto;
}

.form-group {
    margin-bottom: 12px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    color: #333;
    font-weight: 600;
    font-size: 14px;
}

.form-group select,
.form-group input {
    width: 100%;
    padding: 10px;
    border: 2px solid #e1e5e9;
    border-radius: 12px;
    font-size: 16px;
    transition: all 0.3s ease;
    background: #f8f9fa;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05) inset;
    color: #444;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
}

.form-group select {
    background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="%23667eea" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M6 9l6 6 6-6"/></svg>');
    background-repeat: no-repeat;
    background-position: right 15px center;
    background-size: 16px;
    padding-right: 45px;
    cursor: pointer;
}

.form-group select:hover,
.form-group input:hover {
    border-color: #c0c9e1;
    background-color: #fcfcfc;
}

.form-group select:focus,
.form-group input:focus {
    outline: none;
    border-color: #667eea;
    background-color: white;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.15), 0 1px 3px rgba(0, 0, 0, 0.1) inset;
    color: #333;
}

.form-group select option {
    padding: 10px;
    background-color: white;
    color: #333;
}

.form-group select optgroup {
    font-weight: 600;
    color: #667eea;
    background-color: #f8f9fa;
}

.search-box {
    position: relative;
    margin-bottom: 1px;
}

.search-box input {
    padding-right: 45px;
    padding-left: 20px;
    background: linear-gradient(to bottom, #ffffff 0%, #f8f9fa 100%);
    border-color: #d8e0f0;
}

.search-box input:hover {
    background: linear-gradient(to bottom, #ffffff 0%, #f9f9f9 100%);
    border-color: #c0c9e1;
}

.search-box input:focus {
    background: white;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.15), 0 1px 5px rgba(0, 0, 0, 0.05) inset;
}

.search-box::after {
    content: "🔍";
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    pointer-events: none;
    font-size: 1.2em;
    opacity: 0.7;
    transition: opacity 0.3s ease;
}

.search-box:hover::after {
    opacity: 1;
}

.autocomplete-container {
    position: absolute;
    width: 100%;
    max-height: 200px;
    overflow-y: auto;
    background: white;
    border: 2px solid #e1e5e9;
    border-radius: 0 0 10px 10px;
    z-index: 10;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    display: none;
}

.autocomplete-item {
    padding: 10px 15px;
    cursor: pointer;
    border-bottom: 1px solid #f0f0f0;
    transition: background 0.2s;
}

.autocomplete-item:hover, .autocomplete-item.selected {
    background: #f8f9fa;
}

.autocomplete-category {
    font-size: 0.8em;
    color: #666;
    margin-left: 5px;
}

.autocomplete-item strong {
    color: #764ba2;
    font-weight: 700;
}

.conversion-section {
    background: #f8f9fa;
    border-radius: 15px;
    padding: 25px;
    margin: 10px 0;
}

.input-group {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 20px;
    position: relative;
}

.input-group::after {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    color: white;
    font-weight: bold;
    font-size: 20px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
    z-index: 2;
    opacity: 0.9;
}

.input-group::before {
    content: "⇄";
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: white;
    font-size: 20px;
    z-index: 3;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

.input-wrapper {
    position: relative;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    border-radius: 12px;
    overflow: hidden;
    background: white;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.input-wrapper:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.1);
}

.input-wrapper input {
    padding: 18px 50px 18px 18px;
    font-weight: 500;
    letter-spacing: 0.5px;
    text-align: center;
    font-size: 1.3em;
    background: linear-gradient(to bottom, #ffffff 0%, #f9f9f9 100%);
    border: 2px solid #d8e0f0;
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05) inset;
    transition: all 0.3s ease;
    width: 100%;
}

.input-wrapper input:focus {
    background: white;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.15), 0 1px 5px rgba(0, 0, 0, 0.1) inset;
    border-color: #667eea;
    outline: none;
}

.input-wrapper input:hover {
    border-color: #c0c9e1;
    background: linear-gradient(to bottom, #ffffff 0%, #f5f7ff 100%);
}

.input-wrapper input[type=number]::-webkit-inner-spin-button, 
.input-wrapper input[type=number]::-webkit-outer-spin-button { 
    -webkit-appearance: none; 
    margin: 0; 
}

.input-wrapper input[type=number] {
    -moz-appearance: textfield;
}

.unit-label {
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: #555;
    font-weight: 600;
    pointer-events: none;
    background: rgba(230, 230, 240, 0.3);
    padding: 6px 10px;
    border-radius: 8px;
    font-size: 0.95em;
    transition: all 0.3s ease;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    letter-spacing: 0.5px;
}

.input-wrapper input:focus + .unit-label {
    color: #667eea;
    background: rgba(102, 126, 234, 0.15);
    box-shadow: 0 1px 5px rgba(102, 126, 234, 0.2);
    transform: translateY(-50%) scale(1.05);
}

.input-wrapper:hover .unit-label {
    background: rgba(230, 230, 240, 0.5);
}

.info-button {
    background: linear-gradient(135deg, #2196f3 0%, #1976d2 100%);
    color: white;
    border: none;
    border-radius: 8px;
    padding: 8px 15px;
    font-size: 0.9em;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    transition: all 0.3s ease;
}

.info-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(33, 150, 243, 0.3);
}

.info-button.disabled-btn {
    opacity: 0.5;
    cursor: not-allowed;
    background: linear-gradient(135deg, #9e9e9e 0%, #757575 100%);
    transform: none;
}

.info-button.disabled-btn:hover {
    transform: none;
    box-shadow: none;
}

.modal {
    display: none;
    position: fixed;
    z-index: 100;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.5);
    animation: fadeIn 0.3s;
}

.modal-content {
    background: white;
    margin: 10% auto;
    padding: 30px;
    border-radius: 15px;
    box-shadow: 0 5px 30px rgba(0, 0, 0, 0.3);
    max-width: 500px;
    width: 90%;
    position: relative;
    animation: slideIn 0.3s;
}

.close-modal {
    position: absolute;
    right: 20px;
    top: 15px;
    font-size: 28px;
    font-weight: bold;
    color: #aaa;
    cursor: pointer;
    transition: color 0.2s;
}

.close-modal:hover {
    color: #333;
}

.info-section h3 {
    color: #1976d2;
    margin-bottom: 10px;
    font-size: 1.2em;
}

.info-section p {
    color: #333;
    line-height: 1.6;
    margin-bottom: 10px;
}

.conversion-tables {
    margin-top: 30px;
}

.conversion-tables h2 {
    text-align: center;
    color: #333;
    margin-bottom: 20px;
}

.conversion-tables h3 {
    color: #764ba2;
    font-size: 1.2em;
    margin-top: 20px;
    margin-bottom: 10px;
    border-bottom: 2px solid #764ba2;
    padding-bottom: 5px;
}

.conversion-tables table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 20px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    border-radius: 10px;
    overflow: hidden;
}

.conversion-tables th,
.conversion-tables td {
    padding: 12px 15px;
    text-align: left;
}

.conversion-tables thead {
    background-color: #764ba2;
    color: white;
}

.conversion-tables tbody tr:nth-child(even) {
    background-color: #f8f9fa;
}

.conversion-tables tbody tr:hover {
    background-color: #f1f1f1;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

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