@font-face {
    font-family: 'FiraCode';
    src: url('../fonts/FiraCode-Regular.ttf') format('truetype');
    font-weight: normal;
    font-style: normal;
}

*, *::before, *::after { box-sizing: border-box; }

body {
    margin: 0;
    padding: 0;
    background-color: #27272f;
    color: #929295;
    font-family: 'FiraCode', monospace !important;
    font-size: 13px !important;
    word-spacing: 0px !important;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* ── Header ── */
#header-container {
    display: flex;
    justify-content: space-evenly;
    align-items: center;
    min-height: 54px;
    border-bottom: 1px solid #ec7519;
    padding: 0 24px;
    flex-wrap: wrap;
    gap: 10px 150px;
}

#logo h1 { margin: 0; }
#logo h1 a { color: #ec7519; text-decoration: none; }
nav ul { display: flex; list-style: none; padding: 0; margin: 0; gap: 20px; flex-wrap: wrap; }
nav a { color: #929295; text-decoration: none; transition: color 0.2s; }
nav a:hover { color: #ec7519; }

main {
    flex: 1;
}

footer {
    border-top: 1px solid #ec7519;
    text-align: center;
    height: 50px;
}

footer a { color: #ec7519; }

/* ── Page layout ── */
#convert {
    width: 94%;
    max-width: 1100px;
    margin: 32px auto 80px;
    display: grid;
    grid-template-columns: 1fr;
    gap: 20px;
}

/* ── Converter card ── */
#convert > div {
    background-color: #32333d;
    border: 1px solid #3e3f4a;
    border-radius: 10px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
    height: auto;
    width: auto;
    margin: 0;
    padding: 0;
    text-align: left;
}
#convert > div:hover {
    border-color: #ec7519;
    box-shadow: 0 6px 22px rgba(236,117,25,0.1);
    transform: translateY(-2px);
}

/* Card title */
#convert > div > p:first-of-type {
    background-color: #3a3b45;
    color: #e8e8ea;
    font-weight: bold;
    font-size: 13px;
    margin: 0;
    padding: 12px 14px;
    border-bottom: 1px solid #2c2d36;
    border-left: 3px solid #ec7519;
}

/* Card body */
.card-body {
    padding: 14px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    flex: 1;
}

/* Input */
#convert input[type="text"] {
    width: 100%;
    background-color: #27272f;
    color: #e0e0e2;
    border: 1px solid #3e3f4a;
    border-radius: 6px;
    padding: 8px 12px;
    font-family: 'FiraCode', monospace;
    font-size: 12px;
    outline: none;
    transition: border-color 0.2s;
}
#convert input[type="text"]:hover,
#convert input[type="text"]:focus { border-color: #ec7519; }
#convert input[type="text"]::placeholder { color: #555; }

/* Button */
#convert button {
    align-self: flex-start;
    background-color: transparent;
    color: #ec7519;
    border: 1px solid #ec7519;
    border-radius: 6px;
    padding: 7px 18px;
    cursor: pointer;
    font-family: 'FiraCode', monospace;
    font-size: 12px;
    width: auto;
    transition: background-color 0.2s;
}
#convert button:hover {
    background-color: rgba(236,117,25,0.1);
    color: #ec7519;
    border-color: #ec7519;
}

/* Result output */
.result-box {
    background-color: #27272f;
    border: 1px solid #3e3f4a;
    border-radius: 6px;
    padding: 10px 12px;
    font-size: 11px;
    color: #929295;
    word-break: break-all;
    white-space: pre-wrap;
    line-height: 1.6;
    min-height: 48px;
    flex: 1;
}
.result-box.loading { color: #555; font-style: italic; }
.result-box.error   { color: #c0392b; }
.result-box.success { color: #929295; }

/* Spinner inside result */
.result-spinner {
    display: inline-block;
    width: 12px;
    height: 12px;
    border: 2px solid #3e3f4a;
    border-top-color: #ec7519;
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
    margin-right: 6px;
    vertical-align: middle;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Responsive ── */
@media (max-width: 700px) {
    #convert { width: 96%; grid-template-columns: 1fr; margin: 16px auto 60px; }
    #header-container { flex-direction: column; height: auto; padding: 10px 16px; gap: 8px; }
    nav ul { gap: 12px; justify-content: center; }
}
