/* 3D GLB 뷰어 애플리케이션의 전체 스타일 및 테마 정의 */

@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700&display=swap');

:root {
    --bg-primary: #0a0b0d;
    --bg-secondary: #12141c;
    --bg-card: rgba(25, 28, 41, 0.65);
    --border-color: rgba(255, 255, 255, 0.08);
    --border-hover: rgba(138, 92, 246, 0.4);
    
    --text-primary: #f3f4f6;
    --text-secondary: #9ca3af;
    --text-muted: #6b7280;
    
    --accent-primary: #8b5cf6; /* Violet */
    --accent-secondary: #ec4899; /* Pink */
    --accent-glow: rgba(139, 92, 246, 0.3);
    
    --transition-smooth: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

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

body {
    font-family: 'Outfit', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background-color: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
    overflow-x: hidden;
    line-height: 1.5;
}

/* Background Gradients */
.bg-glow {
    position: fixed;
    top: -10%;
    left: -10%;
    width: 60%;
    height: 60%;
    background: radial-gradient(circle, rgba(139, 92, 246, 0.08) 0%, rgba(0,0,0,0) 70%);
    z-index: -1;
    pointer-events: none;
}

.bg-glow-alt {
    position: fixed;
    bottom: -10%;
    right: -10%;
    width: 60%;
    height: 60%;
    background: radial-gradient(circle, rgba(236, 72, 153, 0.05) 0%, rgba(0,0,0,0) 70%);
    z-index: -1;
    pointer-events: none;
}

/* Dashboard Layout */
.dashboard-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 4rem 2rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    position: relative;
}

.header {
    text-align: center;
    margin-bottom: 4rem;
}

.header h1 {
    font-size: 3.5rem;
    font-weight: 700;
    background: linear-gradient(135deg, #fff 30%, #a78bfa 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    letter-spacing: -0.05em;
    margin-bottom: 1rem;
}

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

.grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 2.5rem;
    width: 100%;
    padding: 1rem 0;
}

/* Glassmorphism Card */
.card {
    background: var(--bg-card);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--border-color);
    border-radius: 24px;
    padding: 2.5rem;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    min-height: 380px;
    text-decoration: none;
    color: inherit;
    transition: var(--transition-smooth);
    position: relative;
    overflow: hidden;
    cursor: pointer;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

.card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.1) 0%, rgba(236, 72, 153, 0.05) 100%);
    opacity: 0;
    transition: var(--transition-smooth);
    z-index: 0;
}

.card:hover {
    transform: translateY(-8px);
    border-color: var(--border-hover);
    box-shadow: 0 20px 40px rgba(139, 92, 246, 0.15), 0 0 0 1px var(--border-hover);
}

.card:hover::before {
    opacity: 1;
}

.card-content {
    position: relative;
    z-index: 1;
}

.card-icon {
    width: 64px;
    height: 64px;
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.05);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 2rem;
    font-size: 1.8rem;
    border: 1px solid var(--border-color);
    color: var(--accent-primary);
    transition: var(--transition-smooth);
}

.card:hover .card-icon {
    background: var(--accent-primary);
    color: #fff;
    box-shadow: 0 0 20px var(--accent-glow);
    border-color: transparent;
}

.card-title {
    font-size: 1.75rem;
    font-weight: 600;
    margin-bottom: 0.75rem;
    letter-spacing: -0.02em;
}

.card-desc {
    color: var(--text-secondary);
    font-size: 0.95rem;
    line-height: 1.6;
    font-weight: 300;
}

.card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 2rem;
    position: relative;
    z-index: 1;
}

.card-tag {
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    font-weight: 600;
    color: var(--text-muted);
}

.card-arrow {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition-smooth);
    color: var(--text-secondary);
}

.card:hover .card-arrow {
    border-color: var(--accent-primary);
    color: var(--text-primary);
    background: rgba(139, 92, 246, 0.1);
    transform: translateX(4px);
}

/* Viewer Page Layout */
.viewer-container {
    width: 100vw;
    height: 100vh;
    position: relative;
    overflow: hidden;
}

#canvas-container {
    width: 100%;
    height: 100%;
}

/* UI Overlay */
.overlay-ui {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none; /* Let clicks pass through to canvas */
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 2rem;
}

.overlay-ui * {
    pointer-events: auto; /* Enable pointer events for actual UI elements */
}

.top-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
}

.btn-back {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    background: rgba(18, 20, 28, 0.8);
    backdrop-filter: blur(12px);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    color: var(--text-primary);
    text-decoration: none;
    font-weight: 500;
    font-size: 0.95rem;
    transition: var(--transition-smooth);
}

.btn-back:hover {
    border-color: var(--accent-primary);
    box-shadow: 0 0 15px rgba(139, 92, 246, 0.2);
    transform: translateX(-2px);
}

.model-info-panel {
    background: rgba(18, 20, 28, 0.85);
    backdrop-filter: blur(16px);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    padding: 1.5rem;
    max-width: 320px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.model-title {
    font-size: 1.4rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    background: linear-gradient(135deg, #fff, #a78bfa);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.model-desc {
    font-size: 0.85rem;
    color: var(--text-secondary);
    line-height: 1.5;
    font-weight: 300;
}

.bottom-bar {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    width: 100%;
}

.controls-guide {
    background: rgba(18, 20, 28, 0.8);
    backdrop-filter: blur(12px);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 1rem 1.25rem;
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.controls-guide p {
    margin-bottom: 0.4rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.controls-guide p:last-child {
    margin-bottom: 0;
}

.controls-guide strong {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.1);
    padding: 0.15rem 0.4rem;
    border-radius: 4px;
    font-family: monospace;
}

/* Loading Screen */
.loading-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: var(--bg-primary);
    z-index: 100;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    transition: opacity 0.5s ease-out;
}

.loader-container {
    width: 280px;
    text-align: center;
}

.loader-text {
    font-size: 1.1rem;
    font-weight: 500;
    margin-bottom: 1.25rem;
    letter-spacing: 0.05em;
    background: linear-gradient(135deg, #fff, #a78bfa);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.progress-bar-container {
    width: 100%;
    height: 6px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 10px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.02);
}

.progress-bar {
    width: 0%;
    height: 100%;
    background: linear-gradient(90deg, var(--accent-primary) 0%, var(--accent-secondary) 100%);
    border-radius: 10px;
    transition: width 0.1s ease;
    box-shadow: 0 0 10px rgba(139, 92, 246, 0.5);
}

.progress-percentage {
    margin-top: 0.75rem;
    font-size: 0.85rem;
    color: var(--text-muted);
    font-weight: 500;
}

.error-message {
    color: #ef4444;
    font-size: 0.95rem;
    margin-top: 1rem;
    text-align: center;
    display: none;
}

/* Animations */
@keyframes pulse {
    0%, 100% { opacity: 0.6; }
    50% { opacity: 1; }
}

.pulse {
    animation: pulse 2s infinite ease-in-out;
}

/* GitHub Link Button */
.github-link {
    position: absolute;
    top: 2rem;
    right: 2rem;
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.65rem 1.3rem;
    background: rgba(255, 255, 255, 0.04);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    color: var(--text-primary);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    transition: var(--transition-smooth);
    z-index: 10;
}

.github-link:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: var(--accent-primary);
    box-shadow: 0 0 20px rgba(139, 92, 246, 0.15);
    transform: translateY(-2px);
}

.github-link svg {
    fill: currentColor;
}

/* Responsive adjustments for GitHub Link */
@media (max-width: 980px) {
    .github-link {
        position: static;
        margin-bottom: 2rem;
    }
}
