/* 다크 테마 기본 스타일 */
:root {
    --bg-primary: #0f0f23;
    --bg-secondary: #1a1a35;
    --bg-tertiary: #25253a;
    --text-primary: #ffffff;
    --text-secondary: #a0a0a0;
    --accent: #00d4aa;
    --accent-hover: #00b899;
    --border: #333356;
    --error: #ff4757;
    --success: #2ed573;
    --warning: #ffa502;
}

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

body {
    font-family: 'SF Pro Display', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
}

.container {
    min-height: 100vh;
    position: relative;
}

/* 화면 전환 */
.screen {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.screen.active {
    opacity: 1;
    visibility: visible;
}

/* 로그인 화면 */
#loginScreen {
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--bg-primary) 0%, var(--bg-secondary) 100%);
}

.login-form {
    background: var(--bg-secondary);
    padding: 3rem;
    border-radius: 16px;
    border: 1px solid var(--border);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.5);
    width: 100%;
    max-width: 400px;
    text-align: center;
}

.login-form h1 {
    font-size: 2rem;
    margin-bottom: 0.5rem;
    color: var(--accent);
}

.login-form p {
    color: var(--text-secondary);
    margin-bottom: 2rem;
}

/* 폼 스타일 */
.form-group {
    margin-bottom: 1.5rem;
    text-align: left;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    color: var(--text-secondary);
    font-size: 0.9rem;
    font-weight: 500;
}

.form-group input {
    width: 100%;
    padding: 0.75rem;
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text-primary);
    font-size: 1rem;
    transition: border-color 0.2s;
}

.form-group input:focus {
    outline: none;
    border-color: var(--accent);
}

/* 버튼 스타일 */
.btn-primary {
    background: var(--accent);
    color: white;
    border: none;
    padding: 0.75rem 2rem;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.2s;
    width: 100%;
}

.btn-primary:hover {
    background: var(--accent-hover);
}

.btn-secondary {
    background: transparent;
    color: var(--text-secondary);
    border: 1px solid var(--border);
    padding: 0.5rem 1rem;
    border-radius: 6px;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-secondary:hover {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

/* 에러 메시지 */
.error-message {
    color: var(--error);
    font-size: 0.9rem;
    margin-top: 1rem;
    padding: 0.5rem;
    border-radius: 4px;
    background: rgba(255, 71, 87, 0.1);
    border: 1px solid rgba(255, 71, 87, 0.3);
    display: none;
}

.error-message.show {
    display: block;
}

/* 뷰어 화면 */
#viewerScreen {
    padding: 2rem;
    overflow-y: auto;
}

header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border);
}

/* API 폼 */
.api-form {
    background: var(--bg-secondary);
    padding: 2rem;
    border-radius: 12px;
    border: 1px solid var(--border);
    margin-bottom: 2rem;
}

.params-section {
    margin-top: 1.5rem;
}

.params-section h3 {
    margin-bottom: 1rem;
    color: var(--accent);
    font-size: 1.1rem;
}

.params-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1rem;
}

/* 요청 헤더 섹션 */
.request-headers-section {
    background: var(--bg-secondary);
    padding: 1.5rem;
    border-radius: 12px;
    border: 1px solid var(--border);
    margin-bottom: 2rem;
    display: none;
}

.request-headers-section.show {
    display: block;
}

.request-headers-section h3 {
    color: var(--accent);
    font-size: 1rem;
    margin-bottom: 1rem;
}

.request-headers-section pre {
    background: var(--bg-primary);
    padding: 1.25rem;
    border-radius: 8px;
    border: 1px solid var(--border);
    font-family: 'SF Mono', 'Fira Code', 'Cascadia Code', 'Consolas', monospace;
    font-size: 0.85rem;
    line-height: 1.8;
    overflow-x: auto;
    white-space: pre-wrap;
    color: #00d4aa;
}

/* 로딩 */
.loading {
    display: none;
    text-align: center;
    padding: 2rem;
}

.loading.show {
    display: block;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid var(--bg-tertiary);
    border-top: 4px solid var(--accent);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 1rem;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* 응답 섹션 */
.response-section {
    background: var(--bg-secondary);
    border-radius: 12px;
    border: 1px solid var(--border);
    overflow: hidden;
    display: none;
}

.response-section.show {
    display: block;
}

.response-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem;
    border-bottom: 1px solid var(--border);
}

.response-info {
    display: flex;
    gap: 1rem;
    font-size: 0.9rem;
}

.response-tabs {
    display: flex;
    border-bottom: 1px solid var(--border);
}

.tab-btn {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    padding: 1rem 1.5rem;
    cursor: pointer;
    transition: all 0.2s;
    border-bottom: 2px solid transparent;
}

.tab-btn.active {
    color: var(--accent);
    border-bottom-color: var(--accent);
}

.tab-btn:hover {
    background: var(--bg-tertiary);
}

.tab-content {
    display: none;
    padding: 1.5rem;
    max-height: 70vh;
    overflow-y: auto;
}

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

.tab-content pre {
    background: var(--bg-primary);
    padding: 1rem;
    border-radius: 8px;
    border: 1px solid var(--border);
    font-size: 0.9rem;
    line-height: 1.4;
    overflow-x: auto;
    white-space: pre-wrap;
}

/* 모바일 반응형 */
@media (max-width: 768px) {
    .login-form {
        margin: 1rem;
        padding: 2rem;
    }
    
    #viewerScreen {
        padding: 1rem;
    }
    
    header {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }
    
    .params-grid {
        grid-template-columns: 1fr;
    }
    
    .response-tabs {
        flex-wrap: wrap;
    }
    
    .tab-btn {
        flex: 1;
        min-width: 120px;
    }
}

/* 스크롤바 스타일 */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-tertiary);
}

::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--accent);
}