:root {
    --bg-color: #0f1115;
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    --accent-color: #3b82f6;
    --accent-hover: #2563eb;
    --accent-gradient: linear-gradient(135deg, #3b82f6 0%, #8b5cf6 100%);
    --glass-bg: rgba(30, 41, 59, 0.4);
    --glass-border: rgba(255, 255, 255, 0.1);
    --error-color: #ef4444;
    --success-color: #10b981;
    --font-family: 'Pretendard', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

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

body {
    font-family: var(--font-family);
    background-color: var(--bg-color);
    color: var(--text-primary);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    overflow-x: hidden;
    position: relative;
    line-height: 1.6;
    padding-top: 40px;
    padding-bottom: 40px;
}

/* Background Effects */
.background-effects {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: -1;
    overflow: hidden;
}

.glow {
    position: absolute;
    border-radius: 50%;
    filter: blur(100px);
    opacity: 0.4;
    animation: float 20s infinite alternate;
}

.glow-1 {
    top: -10%;
    left: -10%;
    width: 50vw;
    height: 50vw;
    background: radial-gradient(circle, rgba(59, 130, 246, 0.3) 0%, rgba(15, 17, 21, 0) 70%);
}

.glow-2 {
    bottom: -10%;
    right: -10%;
    width: 40vw;
    height: 40vw;
    background: radial-gradient(circle, rgba(139, 92, 246, 0.3) 0%, rgba(15, 17, 21, 0) 70%);
    animation-delay: -5s;
}

.glow-3 {
    top: 40%;
    left: 60%;
    width: 30vw;
    height: 30vw;
    background: radial-gradient(circle, rgba(16, 185, 129, 0.15) 0%, rgba(15, 17, 21, 0) 70%);
    animation-delay: -10s;
}

@keyframes float {
    0% {
        transform: translate(0, 0) scale(1);
    }

    100% {
        transform: translate(50px, 30px) scale(1.1);
    }
}

/* Container & Layout */
.container {
    width: 100%;
    max-width: 800px;
    padding: 0 20px;
    z-index: 1;
    display: flex;
    flex-direction: column;
    gap: 32px;
}

/* Header */
.header {
    text-align: center;
    margin-bottom: 10px;
    animation: slideDown 0.8s ease-out forwards;
}

.badge {
    display: inline-block;
    padding: 6px 12px;
    border-radius: 20px;
    background: rgba(59, 130, 246, 0.1);
    border: 1px solid rgba(59, 130, 246, 0.3);
    color: var(--accent-color);
    font-size: 0.85rem;
    font-weight: 600;
    letter-spacing: 0.5px;
    margin-bottom: 16px;
    text-transform: uppercase;
}

h1 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 16px;
    background: linear-gradient(to right, #ffffff, #94a3b8);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    letter-spacing: -0.5px;
}

.header p {
    font-size: 1.1rem;
    color: var(--text-secondary);
    max-width: 600px;
    margin: 0 auto 20px;
}

.highlight {
    color: #e2e8f0;
    font-weight: 600;
    position: relative;
    display: inline-block;
}

.highlight::after {
    content: '';
    position: absolute;
    bottom: 2px;
    left: 0;
    width: 100%;
    height: 4px;
    background: var(--accent-gradient);
    border-radius: 2px;
    opacity: 0.5;
    z-index: -1;
}

/* Guide Button */
.guide-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 18px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    color: var(--text-secondary);
    cursor: pointer;
    font-family: inherit;
    font-size: 0.85rem;
    transition: all 0.3s ease;
}

.guide-btn svg {
    width: 16px;
    height: 16px;
}

.guide-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
    transform: translateY(-1px);
}

/* Glass Panels */
.glass-panel {
    background: var(--glass-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--glass-border);
    border-radius: 24px;
    padding: 32px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

/* Input Section */
.input-section {
    animation: fadeIn 1s ease-out 0.2s forwards;
    opacity: 0;
}

.input-group label {
    display: block;
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 12px;
}

.input-wrapper {
    position: relative;
    margin-bottom: 20px;
}

.icon-link {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    width: 20px;
    height: 20px;
    color: var(--text-muted);
}

input[type="url"] {
    width: 100%;
    padding: 16px 16px 16px 48px;
    background: rgba(15, 17, 21, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    color: var(--text-primary);
    font-size: 1rem;
    font-family: inherit;
    transition: all 0.3s ease;
}

input[type="url"]:focus {
    outline: none;
    border-color: rgba(59, 130, 246, 0.5);
    background: rgba(15, 17, 21, 0.8);
    box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.1);
}

input[type="url"]::placeholder {
    color: var(--text-muted);
}

/* Primary Button */
.primary-btn {
    width: 100%;
    padding: 16px;
    background: var(--accent-gradient);
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 1.05rem;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    transition: all 0.3s ease;
    box-shadow: 0 10px 20px -10px rgba(59, 130, 246, 0.5);
    margin-top: 20px;
}

.primary-btn svg {
    width: 20px;
    height: 20px;
    transition: transform 0.3s ease;
}

.primary-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 15px 25px -10px rgba(59, 130, 246, 0.6);
    filter: brightness(1.1);
}

.primary-btn:active {
    transform: translateY(0);
}

.primary-btn:hover svg {
    transform: translateX(4px);
}

.error-message {
    color: var(--error-color);
    font-size: 0.9rem;
    margin-top: 12px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.error-message::before {
    content: '⚠';
    font-weight: bold;
}

/* User Options */
.user-options {
    display: flex;
    gap: 16px;
    margin-top: 24px;
    padding-top: 24px;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.option-group {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.option-group label {
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-secondary);
}

.glass-select {
    width: 100%;
    padding: 12px 16px;
    background: rgba(15, 17, 21, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    color: var(--text-primary);
    font-size: 0.95rem;
    font-family: inherit;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background-image: url("data:image/svg+xml;charset=US-ASCII,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%22292.4%22%20height%3D%22292.4%22%3E%3Cpath%20fill%3D%22%2394a3b8%22%20d%3D%22M287%2069.4a17.6%2017.6%200%200%200-13-5.4H18.4c-5%200-9.3%201.8-12.9%205.4A17.6%2017.6%200%200%200%200%2082.2c0%205%201.8%209.3%205.4%2012.9l128%20127.9c3.6%203.6%207.8%205.4%2012.8%205.4s9.2-1.8%2012.8-5.4L287%2095c3.5-3.5%205.4-7.8%205.4-12.8%200-5-1.9-9.2-5.5-12.8z%22%2F%3E%3C%2Fsvg%3E");
    background-repeat: no-repeat;
    background-position: right 16px top 50%;
    background-size: 12px auto;
    cursor: pointer;
    transition: all 0.3s ease;
}

.glass-select:focus {
    outline: none;
    border-color: rgba(59, 130, 246, 0.5);
    background-color: rgba(15, 17, 21, 0.8);
    box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.1);
}

.glass-select option {
    background: #1e293b;
    color: #f8fafc;
    padding: 8px;
}

/* Output Mode Section */
.output-mode-section {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.output-mode-label {
    display: block;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 12px;
}

.output-mode-group {
    display: flex;
    gap: 12px;
}

.mode-radio {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    background: rgba(15, 17, 21, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.mode-radio:hover {
    background: rgba(15, 17, 21, 0.6);
    border-color: rgba(59, 130, 246, 0.3);
}

.mode-radio input[type="radio"] {
    display: none;
}

.radio-mark {
    width: 18px;
    height: 18px;
    border: 2px solid var(--text-muted);
    border-radius: 50%;
    position: relative;
    flex-shrink: 0;
    transition: all 0.3s ease;
}

.mode-radio input[type="radio"]:checked~.radio-mark {
    border-color: var(--accent-color);
    background: var(--accent-color);
    box-shadow: 0 0 8px rgba(59, 130, 246, 0.4);
}

.mode-radio input[type="radio"]:checked~.radio-mark::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 6px;
    height: 6px;
    background: #fff;
    border-radius: 50%;
}

.radio-label {
    font-size: 0.9rem;
    color: var(--text-primary);
}

.radio-label small {
    display: block;
    color: var(--text-muted);
    font-size: 0.75rem;
    margin-top: 2px;
}

/* Tab Bar */
.tab-bar {
    display: flex;
    gap: 4px;
    background: rgba(15, 17, 21, 0.4);
    padding: 4px;
    border-radius: 12px;
    margin-bottom: 20px;
}

.tab-btn {
    flex: 1;
    padding: 10px 16px;
    border: none;
    border-radius: 8px;
    background: transparent;
    color: var(--text-muted);
    font-family: inherit;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
}

.tab-btn:hover {
    color: var(--text-secondary);
}

.tab-btn.active {
    background: var(--accent-gradient);
    color: #fff;
    font-weight: 600;
    box-shadow: 0 4px 12px -4px rgba(59, 130, 246, 0.5);
}

/* Tab Content */
.tab-content {
    display: none;
    animation: tabFadeIn 0.3s ease forwards;
}

.tab-content.active {
    display: block;
}

@keyframes tabFadeIn {
    from {
        opacity: 0;
        transform: translateY(8px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Result Section */
.result-section {
    padding: 24px;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    transform-origin: top;
    position: relative;
}

.result-section.hidden {
    display: none;
    opacity: 0;
    transform: scaleY(0.9) translateY(-20px);
}

.result-section.visible {
    display: block;
    animation: revealResult 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}

@keyframes revealResult {
    0% {
        opacity: 0;
        transform: scaleY(0.9) translateY(-20px);
    }

    100% {
        opacity: 1;
        transform: scaleY(1) translateY(0);
    }
}

.result-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

h2 {
    font-size: 1.2rem;
    font-weight: 600;
    color: #e2e8f0;
}

.icon-btn {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
    padding: 8px 16px;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    font-family: inherit;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.2s ease;
}

.icon-btn svg {
    width: 18px;
    height: 18px;
}

.icon-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: translateY(-1px);
}

.prompt-container {
    position: relative;
    border-radius: 12px;
    overflow: hidden;
}

textarea {
    width: 100%;
    height: 350px;
    background: rgba(5, 5, 5, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    padding: 20px;
    color: #cbd5e1;
    font-family: 'Consolas', 'Monaco', monospace;
    font-size: 0.9rem;
    line-height: 1.7;
    resize: vertical;
    outline: none;
    display: block;
}

textarea::-webkit-scrollbar {
    width: 8px;
}

textarea::-webkit-scrollbar-track {
    background: transparent;
}

textarea::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 4px;
}

textarea::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* Explain Content */
.explain-content {
    background: rgba(5, 5, 5, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    padding: 24px;
    color: #cbd5e1;
    font-size: 0.9rem;
    line-height: 1.8;
    max-height: 400px;
    overflow-y: auto;
}

.explain-content h4 {
    color: var(--accent-color);
    margin: 16px 0 8px;
    font-size: 1rem;
}

.explain-content h4:first-child {
    margin-top: 0;
}

.explain-content p {
    margin-bottom: 8px;
    color: var(--text-secondary);
}

.explain-content ul {
    margin: 8px 0 16px 20px;
    color: var(--text-secondary);
}

.explain-content li {
    margin-bottom: 4px;
}

.explain-content strong {
    color: #e2e8f0;
}

.explain-content::-webkit-scrollbar {
    width: 8px;
}

.explain-content::-webkit-scrollbar-track {
    background: transparent;
}

.explain-content::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 4px;
}

/* Copy Overlay */
.copy-success-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(16, 185, 129, 0.1);
    backdrop-filter: blur(4px);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 12px;
    color: var(--text-primary);
    font-weight: 600;
    font-size: 1.1rem;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
    border-radius: 24px;
    z-index: 5;
}

.copy-success-overlay svg {
    width: 48px;
    height: 48px;
}

.copy-success-overlay.show {
    opacity: 1;
    z-index: 10;
}

/* 닥신 소개 섹션 */
.daksin-intro {
    text-align: center;
    animation: fadeIn 1s ease-out 0.5s forwards;
    opacity: 0;
}

.intro-icon {
    font-size: 2.5rem;
    margin-bottom: 12px;
}

.daksin-intro h3 {
    font-size: 1.3rem;
    font-weight: 600;
    color: #e2e8f0;
    margin-bottom: 12px;
}

.daksin-intro p {
    font-size: 0.95rem;
    color: var(--text-secondary);
    max-width: 560px;
    margin: 0 auto 20px;
    line-height: 1.7;
}

.intro-links {
    display: flex;
    justify-content: center;
    gap: 12px;
    flex-wrap: wrap;
}

.intro-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    border-radius: 12px;
    font-size: 0.9rem;
    font-weight: 500;
    text-decoration: none;
    transition: all 0.3s ease;
}

.intro-link:first-child {
    background: rgba(255, 0, 0, 0.1);
    border: 1px solid rgba(255, 0, 0, 0.2);
    color: #ff6b6b;
}

.intro-link:first-child:hover {
    background: rgba(255, 0, 0, 0.2);
    transform: translateY(-2px);
}

.intro-link.github-link {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--text-secondary);
}

.intro-link.github-link:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
    transform: translateY(-2px);
}

.intro-link svg {
    width: 18px;
    height: 18px;
}

/* Footer */
.footer {
    text-align: center;
    margin-top: 20px;
    color: var(--text-muted);
    font-size: 0.9rem;
    animation: fadeIn 1s ease-out 0.4s forwards;
    opacity: 0;
}

.footer .sub-text {
    font-size: 0.75rem;
    margin-top: 8px;
    opacity: 0.7;
}

.footer .disclaimer {
    font-size: 0.75rem;
    margin-top: 12px;
    padding: 12px 16px;
    background: rgba(234, 179, 8, 0.08);
    border: 1px solid rgba(234, 179, 8, 0.15);
    border-radius: 12px;
    color: #fbbf24;
    line-height: 1.5;
}

/* Modal */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(8px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    padding: 20px;
    animation: modalIn 0.3s ease forwards;
}

.modal-overlay.hidden {
    display: none;
}

@keyframes modalIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

.modal-content {
    max-width: 560px;
    width: 100%;
    max-height: 85vh;
    overflow-y: auto;
    position: relative;
    animation: modalSlideIn 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: scale(0.9) translateY(20px);
    }

    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.modal-close-btn {
    position: absolute;
    top: 16px;
    right: 16px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--text-secondary);
    width: 36px;
    height: 36px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
}

.modal-close-btn svg {
    width: 20px;
    height: 20px;
}

.modal-close-btn:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.1);
}

.modal-content h2 {
    font-size: 1.4rem;
    margin-bottom: 24px;
}

.guide-steps {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.guide-step {
    display: flex;
    gap: 16px;
    align-items: flex-start;
}

.step-number {
    width: 36px;
    height: 36px;
    flex-shrink: 0;
    background: var(--accent-gradient);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1rem;
    color: #fff;
}

.step-content h4 {
    font-size: 1rem;
    font-weight: 600;
    color: #e2e8f0;
    margin-bottom: 4px;
}

.step-content p {
    font-size: 0.9rem;
    color: var(--text-secondary);
    line-height: 1.6;
}

.step-content a {
    color: var(--accent-color);
    text-decoration: none;
}

.step-content a:hover {
    text-decoration: underline;
}

/* Spinner Animation */
@keyframes spin {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

/* Animations */
@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

/* Hidden utility */
.hidden {
    display: none !important;
}

/* Responsive */
@media (max-width: 640px) {
    h1 {
        font-size: 1.8rem;
    }

    .glass-panel {
        padding: 24px 18px;
        border-radius: 18px;
    }

    .user-options {
        flex-direction: column;
        gap: 12px;
    }

    .output-mode-group {
        flex-direction: column;
        gap: 8px;
    }

    textarea {
        height: 280px;
        font-size: 0.85rem;
    }

    .tab-btn {
        font-size: 0.8rem;
        padding: 8px 10px;
    }

    .result-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }

    .icon-btn {
        width: 100%;
        justify-content: center;
    }
}