/**
 * rhwp 테스트 페이지 스타일
 */

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Noto Sans KR', sans-serif;
    background: #f0f2f5;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* 헤더 */
header {
    background: linear-gradient(135deg, #1a237e 0%, #3949ab 100%);
    color: white;
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

header h1 {
    font-size: 1.5rem;
    font-weight: 600;
}

.header-controls {
    display: flex;
    align-items: center;
    gap: 1rem;
}

#file-input {
    display: none;
}

.file-label {
    background: rgba(255, 255, 255, 0.2);
    padding: 0.5rem 1rem;
    border-radius: 4px;
    cursor: pointer;
    transition: background 0.2s;
    color: white;
    text-decoration: none;
}

.file-label:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* 메인 컨텐츠 */
main {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 1rem;
    gap: 1rem;
}

/* 정보 패널 */
#info-panel {
    background: #fff;
    padding: 1rem 1.5rem;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.info-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem 2rem;
}

.info-item {
    display: flex;
    gap: 0.5rem;
}

.info-item .label {
    color: #666;
    font-weight: 500;
}

.info-item .value {
    color: #333;
}

.placeholder {
    color: #999;
    font-style: italic;
}

.error {
    color: #d32f2f;
    padding: 1rem;
}

/* 렌더링 패널 */
#render-panel {
    display: flex;
    gap: 1rem;
    flex: 1;
    min-height: 0;
}

#svg-view, #canvas-view {
    flex: 1;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

#svg-view h3, #canvas-view h3 {
    padding: 0.75rem 1rem;
    background: #f5f5f5;
    border-bottom: 1px solid #e0e0e0;
    font-size: 0.9rem;
    font-weight: 600;
    color: #555;
}

#svg-container, #canvas-container {
    flex: 1;
    padding: 1rem;
    overflow: auto;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    background: #fafafa;
}

#svg-container svg {
    max-width: 100%;
    height: auto;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

#hwp-canvas {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    background: #fff;
    max-width: 100%;
    height: auto;
}

#hwp-canvas.hidden {
    display: none;
}

#canvas-placeholder {
    color: #999;
    font-style: italic;
}

#canvas-container.loaded #canvas-placeholder {
    display: none;
}

#canvas-container.loaded #hwp-canvas {
    display: block;
}

/* 페이지 네비게이션 */
#page-nav {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

#page-info {
    min-width: 80px;
    text-align: center;
    font-weight: 500;
    color: #333;
}

button {
    padding: 0.5rem 1rem;
    background: #3949ab;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: background 0.2s;
}

button:hover:not(:disabled) {
    background: #1a237e;
}

button:disabled {
    background: #ccc;
    cursor: not-allowed;
}

/* 푸터 */
footer {
    background: #333;
    color: #999;
    padding: 0.75rem;
    text-align: center;
    font-size: 0.85rem;
}

footer span {
    color: #ccc;
}

/* 로딩 오버레이 */
#loading {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 1rem;
    color: white;
    z-index: 1000;
}

#loading.hidden {
    display: none;
}

.spinner {
    width: 48px;
    height: 48px;
    border: 4px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* 반응형 */
@media (max-width: 900px) {
    #render-panel {
        flex-direction: column;
    }

    #svg-view, #canvas-view {
        min-height: 400px;
    }
}

@media (max-width: 600px) {
    header {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }

    .info-grid {
        flex-direction: column;
        gap: 0.5rem;
    }
}
