@import url('https://cdn.jsdelivr.net/gh/orioncactus/pretendard/dist/web/static/pretendard.css');
:root {
    --font-main: 'Pretendard', -apple-system, BlinkMacSystemFont, system-ui, Roboto, sans-serif;
}

:root {
    --primary-color: #000000;
    --bg-sky: #87CEEB;
    --bg-black: #151515;
    --text-color: #000000;
    --text-light: #ffffff;
}

body {
    font-family: var(--font-main);
    margin: 0;
    padding: 0;
    color: var(--text-color);
    background-color: var(--bg-sky);
}

header {
    position: absolute; /* Changed from fixed */
    top: 0;
    left: 0;
    width: 100%;
    height: 60px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 20px;
    box-sizing: border-box;
    z-index: 1000;
}

.menu-btn {
    font-size: 24px;
    cursor: pointer;
    background: none;
    border: none;
    padding: 10px;
    color: var(--text-color);
}

.logo {
    font-size: 1.2rem;
    font-weight: bold;
    color: var(--text-color);
}

section {
    width: 100%;
    min-height: 80vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 2rem;
    box-sizing: border-box;
}

.top-section {
    background-color: var(--bg-sky);
    flex-direction: row; /* Horizontal layout */
    justify-content: flex-start; /* Align content to the left */
    gap: 20%; /* Increased gap to shift right slightly */
    padding: 0 10%;
    align-items: center;
}

.top-section .content-wrapper {
    text-align: left;
    max-width: 500px;
}

.input-wrapper {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    align-items: flex-end;
    margin-top: 5rem; /* Shift down */
    margin-left: 5%; /* Shift right slightly more */
}

.input-label {
    align-self: flex-start; /* Keep label on the left */
    font-size: 1.1rem;
    font-weight: 700;
}

.underline-input {
    background: none;
    border: none;
    border-bottom: 2px solid var(--text-color);
    font-size: 1rem;
    padding: 8px 0;
    width: 500px;
    outline: none;
    color: var(--text-color);
    font-family: inherit;
}

.char-count {
    font-size: 0.8rem;
    color: rgba(0, 0, 0, 0.3);
    margin-top: 0.5rem;
    font-weight: 500;
    transition: color 0.2s;
}

.char-count.limit-reached {
    color: #ff4d4f; /* Red color */
    font-weight: 700;
}

.change-btn {
    margin-top: 0.3rem; /* Slightly reduced margin to accommodate counter */
    padding: 8px 25px;
    background-color: var(--text-color);
    color: white;
    border: none;
    border-radius: 50px; /* Oval shape */
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: opacity 0.2s;
}

.change-btn:hover {
    opacity: 0.8;
}

.underline-input::placeholder {
    color: rgba(0,0,0,0.3);
}

.button-group {
    font-size: 3.5rem;
    font-weight: 800;
    margin-bottom: 1.5rem;
    line-height: 1.2;
}

.top-section p {
    font-size: 1rem; /* Reduced from 1.2rem */
    line-height: 1.6;
    white-space: pre-line;
}

.button-group {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-top: 2rem;
}

.icon-btn {
    display: flex;
    align-items: center;
    gap: 16px;
    background: none;
    border: none;
    padding: 8px 12px;
    margin-left: -12px;
    cursor: pointer;
    font-size: 1.1rem; /* Increased from 0.95rem */
    font-weight: 700;
    color: var(--text-color);
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    border-radius: 8px;
}

.icon-btn:hover {
    background-color: rgba(0, 0, 0, 0.05);
    transform: translateX(4px);
}

.icon-wrapper-svg {
    display: flex;
    justify-content: center;
    align-items: center;
    color: var(--text-color);
    flex-shrink: 0;
}

.circle-icon {
    width: 24px; /* Reduced from 30px to make circle smaller */
    height: 24px;
    border: 2px solid var(--text-color);
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: all 0.2s;
    flex-shrink: 0;
}

.circle-icon svg {
    display: block;
}

.circle-icon.inverted {
    background-color: var(--text-color);
    color: var(--bg-sky);
}

.icon-btn:hover .circle-icon {
    /* No background fill or color change on hover */
    border-color: var(--text-color); 
}

.bottom-section {
    min-height: 80vh;
    background-color: var(--bg-sky);
    color: var(--text-light);
    position: relative;
    padding: 100px 10% 2rem;
    display: none;
    flex-direction: column;
    justify-content: flex-start;
    align-items: center;
    transition: background-color 0.5s ease;
}

/* 활성화 시 배경색 변경 */
.bottom-section.active {
    background-color: var(--bg-black);
    display: flex; /* Ensure it shows */
}

.result-title {
    position: absolute;
    top: 30px;
    left: 50%;
    transform: translateX(-50%); /* Center horizontally first */
    width: 80%; /* Match result-container width */
    max-width: 900px;
    font-size: 1.1rem;
    font-weight: 500;
    color: var(--text-light);
    opacity: 0.8;
    text-align: left; /* Align text to the left of this width-constrained block */
}

.result-container {
    width: 80%;
    max-width: 900px;
    display: flex;
    flex-direction: column;
    margin-top: 0; /* Align directly under padding */
}

.result-box {
    width: 100%;
    min-height: 400px;
    background-color: #1f1f1f; /* Changed from #2c2c2c to #1f1f1f */
    border-radius: 24px;
    position: relative; /* For absolute positioning inside */
    padding: 3rem;
    box-sizing: border-box;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
}

.input-display {
    position: absolute;
    top: 30px;
    left: 40px; /* Moved from right to left */
    text-align: left; /* Changed from right */
}

.input-display .label {
    font-size: 0.9rem;
    color: var(--bg-sky); /* Changed to sky blue */
    margin-bottom: 0.3rem;
    opacity: 0.8;
}

.input-display .value {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--bg-sky); /* Changed to sky blue */
}

.conversion-display {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    margin-top: 5rem;
}

.converted-value-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    flex: 1;
}

.nav-btn {
    background: none;
    border: 2px solid rgba(255,255,255,0.2);
    color: var(--text-light);
    width: 50px;
    height: 50px;
    border-radius: 50%;
    font-size: 1.5rem;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: all 0.2s;
}

.nav-btn:hover {
    background-color: rgba(255,255,255,0.1);
    border-color: var(--text-light);
}

.converted-value {
    font-size: 2.5rem;
    font-weight: 900;
    color: var(--text-light);
}

.copy-btn {
    background-color: rgba(255,255,255,0.1);
    border: none;
    color: var(--text-light);
    padding: 8px 16px;
    border-radius: 8px;
    font-size: 0.9rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: background 0.2s;
}

.copy-btn:hover {
    background-color: rgba(255,255,255,0.2);
}

.pagination-dots {
    display: flex;
    gap: 10px;
    margin-top: 2rem;
}

.dot {
    width: 10px;
    height: 10px;
    background-color: rgba(255,255,255,0.2);
    border-radius: 50%;
    cursor: pointer;
    transition: background-color 0.2s;
}

.dot.active {
    background-color: var(--bg-sky); /* Changed to main theme color */
    transform: scale(1.2);
}

.copy-notification {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background-color: var(--bg-sky);
    color: white;
    padding: 10px 20px;
    border-radius: 50px;
    font-weight: 600;
    opacity: 0;
    transition: all 0.3s ease;
    z-index: 2000;
}

.copy-notification.show {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
}

/* Tutorial Overlay */
.tutorial-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    z-index: 9998; /* Below the spotlighted element */
    display: none;
    justify-content: center;
    align-items: center;
}

.spotlight {
    position: relative;
    z-index: 9999; /* Higher than overlay */
    background: var(--bg-sky); /* Changed to sky blue theme */
    border-radius: 8px;
    padding: 10px;
}

.tutorial-content {
    background: white;
    padding: 2rem;
    border-radius: 12px;
    max-width: 400px;
    text-align: center;
    position: relative;
}

.tutorial-arrow {
    position: absolute;
    font-size: 2rem;
    color: var(--bg-sky);
    font-weight: 800;
    pointer-events: none; /* Allow clicks through arrow */
}

.tutorial-nav {
    display: flex;
    justify-content: space-between;
    margin-top: 2rem;
}

.tutorial-btn {
    padding: 8px 20px;
    background: var(--text-color);
    color: white;
    border: none;
    border-radius: 20px;
    cursor: pointer;
}

/* Mobile Responsive Styles */
@media (max-width: 768px) {
    .top-section {
        flex-direction: column;
        text-align: center;
        padding: 80px 5% 40px;
        justify-content: space-between; /* This pushes one to top and one to bottom */
        min-height: 80vh;
        gap: 2rem;
    }

    .top-section .content-wrapper {
        text-align: center;
        align-items: center;
        display: flex;
        flex-direction: column;
        margin-top: 2rem;
    }

    .input-wrapper {
        width: 100%;
        align-items: flex-start; /* Changed from center to flex-start */
        margin-top: auto;
        margin-left: 0;
        padding: 0 5% 2rem; /* Consistent side padding */
        box-sizing: border-box;
    }

    .underline-input {
        width: 100%; /* Take full available width */
        max-width: none; /* Remove max-width for stability */
    }

    .input-label {
        text-align: left;
        align-self: flex-start;
    }

    .change-btn {
        align-self: flex-end; /* Push button back to the right */
    }

    .result-container {
        width: 95%;
    }

    .result-box {
        padding: 2rem 1rem;
        min-height: 350px;
    }

    .converted-value {
        font-size: 1.8rem;
    }

    .conversion-display {
        gap: 1rem;
    }

    .nav-btn {
        width: 40px;
        height: 40px;
        font-size: 1.2rem;
    }
}
