/* page basics */
html, body {
    height: 100%;
    box-sizing: border-box;
}
*, *::before, *::after {
    box-sizing: inherit;
}

/* background + font */
body {
    margin: 0;
    font-family: 'Segoe UI', sans-serif;
    background: linear-gradient(135deg, #FAFAFA, #96a3b8);
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    color: #333;
}

/* app card */
.app {
    background: #ffffff;
    padding: 30px 30px 40px 30px; 
    width: 380px;
    max-width: calc(100% - 40px);
    border-radius: 16px;
    box-shadow: 0 18px 35px rgba(0, 0, 0, 0.2);
    text-align: center;
    margin: 0 auto; /* make sure it's centered */
}

/* header (title + info) */
.header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 10px;
}

.header h1 {
    font-size: 26px;
    margin: 0;
    font-weight: 600;
}

/* info button */
.info-btn {
    width: 16px;            
    height: 16px;
    border-radius: 50%;
    border: none;
    background: #6c8fcf;    
    color: #ffffff;
    font-size: 10px;
    font-weight: bold;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: 0.2s ease;
    padding: 0;
}

.info-btn:hover {
    background: #4e74b8;
}

/* subtitle text */
.subtitle {
    font-size: 14px;
    color: #666;
    margin-bottom: 20px;
}

/* inputs */
input,
select {
    width: 100%;
    padding: 10px;
    margin: 10px 0;
    border-radius: 8px;
    border: 1px solid #ccc;
    font-size: 14px;
    transition: 0.2s ease;
}

input:focus,
select:focus {
    border: 1px solid #2a5298;
    box-shadow: 0 0 0 2px rgba(42, 82, 152, 0.15);
    outline: none;
}

/* units row */
.select-group {
    display: flex;
    align-items: center;
    gap: 10px;
}

.arrow {
    font-size: 18px;
}

/* convert button */
button#convertBtn {
    width: 100%;
    padding: 12px;
    margin-top: 15px;
    margin-bottom: 15px; /* extra spacing below */
    border: none;
    border-radius: 8px;
    background: #2a5298;
    color: white;
    font-size: 15px;
    cursor: pointer;
    transition: 0.3s ease;
}

button#convertBtn:hover {
    background: #1e3c72;
    transform: translateY(-2px);
}

/* result area */
.result {
    margin-top: 10px;
    font-weight: 600;
    font-size: 16px;
    min-height: 24px;
}

/* note when units match */
.result.note {
    background-color: #f0f4ff;
    border-left: 4px solid #2a5298;
    padding: 10px;
    border-radius: 6px;
    color: #1e3c72;
    font-size: 14px;
    text-align: left;
}

/* tooltip for info button */
.info-btn {
    position: relative;
}

.info-btn::after {
    content: "Converts temperature between:\A\2022 Celsius (°C)\A\2022 Fahrenheit (°F)\A\2022 Kelvin (K)\A\A Select two different units to perform conversion.";
    white-space: pre-wrap;
    position: absolute;
    bottom: -10px;
    right: -10px;
    width: 240px;
    background: #ffffff;
    color: #333;
    font-size: 12px;
    padding: 10px;
    border-radius: 8px;
    box-shadow: 0 8px 20px rgba(0,0,0,0.15);
    opacity: 0;
    transform: translateY(6px);
    pointer-events: none;
    transition: opacity 0.18s ease, transform 0.18s ease;
    border: 1px solid #eee;
    z-index: 10;
    display: block;
}

.info-btn:hover::after,
.info-btn:focus::after {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}