/* Reset & Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    /* Light theme colors */
    --background: #ffffff;
    --foreground: #0a0a0b;
    --card: #ffffff;
    --card-foreground: #0a0a0b;
    --popover: #ffffff;
    --popover-foreground: #0a0a0b;
    --primary: #18181b;
    --primary-foreground: #fafafa;
    --secondary: #f4f4f5;
    --secondary-foreground: #18181b;
    --muted: #f4f4f5;
    --muted-foreground: #71717a;
    --accent: #f4f4f5;
    --accent-foreground: #18181b;
    --destructive: #ef4444;
    --destructive-foreground: #fafafa;
    --border: #e4e4e7;
    --input: #e4e4e7;
    --ring: #18181b;
    --radius: 0.5rem;
}

body.dark {
    /* Dark theme colors */
    --background: #0a0a0b;
    --foreground: #fafafa;
    --card: #0a0a0b;
    --card-foreground: #fafafa;
    --popover: #0a0a0b;
    --popover-foreground: #fafafa;
    --primary: #fafafa;
    --primary-foreground: #18181b;
    --secondary: #27272a;
    --secondary-foreground: #fafafa;
    --muted: #27272a;
    --muted-foreground: #a1a1aa;
    --accent: #27272a;
    --accent-foreground: #fafafa;
    --destructive: #7f1d1d;
    --destructive-foreground: #fafafa;
    --border: #27272a;
    --input: #27272a;
    --ring: #d4d4d8;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue', sans-serif;
    background-color: var(--background);
    color: var(--foreground);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Header */
.header {
    position: sticky;
    top: 0;
    z-index: 50;
    width: 100%;
    border-bottom: 1px solid var(--border);
    background-color: var(--background);
    backdrop-filter: blur(8px);
}

.header-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 60px;
    max-width: 100%;
    margin: 0 auto;
    padding: 0 24px;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 16px;
}

/* Header Sidebar Toggle Button (Hidden) */
.sidebar-toggle {
    display: none;
}

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    color: var(--foreground);
    font-weight: 600;
    font-size: 15px;
    transition: opacity 0.2s ease;
}

.logo:hover {
    opacity: 0.8;
}

.logo-icon {
    font-size: 20px;
}

.logo-img {
    height: 32px;
    width: auto;
    object-fit: contain;
    display: block;
}

.logo-text {
    font-size: 18px;
    font-weight: 800;
    background: linear-gradient(135deg, #ff6b6b, #ff8e53, #ffb347, #ffd93d);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    text-fill-color: transparent;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

.main-nav {
    display: flex;
    align-items: center;
    gap: 6px;
}

.nav-link {
    padding: 8px 12px;
    text-decoration: none;
    color: var(--muted-foreground);
    font-size: 14px;
    font-weight: 500;
    border-radius: var(--radius);
    transition: all 0.2s;
}

.nav-link:hover {
    color: var(--foreground);
    background-color: var(--accent);
}

.nav-link.active {
    color: var(--foreground);
}

.header-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

.search-button {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 48px;
    padding: 8px 12px;
    background-color: transparent;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--muted-foreground);
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s;
    min-width: 280px;
}

.search-button:hover {
    background-color: var(--accent);
    border-color: var(--muted-foreground);
}

.search-shortcut {
    display: flex;
    align-items: center;
    gap: 2px;
}

.search-shortcut span {
    padding: 2px 4px;
    background-color: var(--muted);
    border-radius: 4px;
    font-size: 11px;
    font-weight: 500;
}

.github-link {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    text-decoration: none;
    color: var(--foreground);
    border-radius: var(--radius);
    transition: all 0.2s;
}

.github-link:hover {
    background-color: var(--accent);
}

.star-count {
    font-size: 14px;
    font-weight: 500;
}

.theme-toggle {
    padding: 8px;
    background-color: transparent;
    border: none;
    color: var(--foreground);
    cursor: pointer;
    border-radius: var(--radius);
    transition: all 0.2s;
}

.theme-toggle:hover {
    background-color: var(--accent);
}

/* Main Container */
.main-container {
    display: flex;
    max-width: 100%;
    margin: 0 auto;
    min-height: calc(100vh - 120px);
    position: relative;
}

/* Sidebar */
.sidebar {
    position: fixed;
    left: 0;
    top: 60px;
    width: 48px;
    height: calc(100vh - 60px);
    padding: 0;
    background-color: var(--background);
    border-right: 1px solid var(--border);
    transition: width 0.3s ease;
    z-index: 40;
    overflow-y: hidden;
    overflow-x: hidden;
}

.sidebar.open {
    overflow-y: auto;
}

/* Sidebar Toggle Inside */
.sidebar-toggle-container {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 4px;
    background-color: var(--background);
    position: sticky;
    top: 0;
    z-index: 10;
}

.sidebar.open .sidebar-toggle-container {
    justify-content: flex-start;
    padding-left: 8px;
}

.sidebar-toggle-inside {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    padding: 0;
    background: var(--muted);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--muted-foreground);
    cursor: pointer;
    transition: all 0.2s;
}

.sidebar-toggle-inside:hover {
    background: var(--accent);
    border-color: var(--foreground);
    color: var(--foreground);
    transform: scale(1.05);
}

.sidebar-toggle-inside svg {
    width: 16px;
    height: 16px;
}

.sidebar.open {
    width: 240px;
}

.sidebar-content {
    padding: 2px;
    display: flex;
    flex-direction: column;
    gap: 0;
    transition: opacity 0.3s ease;
}

/* Overlay for mobile */
.sidebar-overlay {
    position: fixed;
    top: 60px;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 35;
    display: none;
}

.sidebar-overlay.active {
    display: block;
}

.sidebar-section {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 2px;
}

/* Sidebar Icons for Closed State */
.sidebar-icon {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--muted);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--muted-foreground);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    opacity: 1;
    flex-shrink: 0;
}

.sidebar.open .sidebar-icon {
    position: absolute;
    left: -9999px;
    opacity: 0;
    pointer-events: none;
}

.sidebar.open .sidebar-section {
    align-items: stretch;
    padding: 4px 12px;
}

.sidebar-icon:hover {
    background: var(--accent);
    border-color: var(--foreground);
    color: var(--foreground);
    transform: scale(1.05);
}

.sidebar-title {
    padding: 6px 12px;
    margin-bottom: 2px;
    font-size: 14px;
    font-weight: 600;
    color: var(--foreground);
    cursor: pointer;
    display: none;
    align-items: center;
    justify-content: space-between;
    transition: all 0.2s;
    border-radius: var(--radius);
}

.sidebar.open .sidebar-title {
    display: flex;
}

.sidebar-title:hover {
    background-color: var(--accent);
}

.sidebar-title.expandable::after {
    content: '';
    display: none;
}

.sidebar-list {
    list-style: none;
    display: none;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
}

.sidebar.open .sidebar-list {
    display: block;
}

.sidebar-list.expanded {
    max-height: 500px;
}

.sidebar-link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 6px 12px;
    padding-left: 36px;
    text-decoration: none;
    color: var(--muted-foreground);
    font-size: 14px;
    border-radius: var(--radius);
    transition: all 0.2s;
    position: relative;
}

.sidebar-link::before {
    content: '';
    position: absolute;
    left: 24px;
    width: 4px;
    height: 4px;
    background-color: var(--muted-foreground);
    border-radius: 50%;
    transition: all 0.2s;
}

.sidebar-link:hover {
    color: var(--foreground);
    background-color: var(--accent);
}

.sidebar-link:hover::before {
    background-color: var(--foreground);
    width: 5px;
    height: 5px;
}

.sidebar-link.active {
    color: var(--foreground);
    background-color: var(--accent);
}

.sidebar-link.active::before {
    background-color: #ff6b6b;
    width: 6px;
    height: 6px;
    box-shadow: 0 0 8px rgba(255, 107, 107, 0.5);
}

/* External Links */
.sidebar-link.external-link {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.sidebar-link.external-link span {
    flex: 1;
}

.external-icon {
    opacity: 0.5;
    flex-shrink: 0;
    transition: opacity 0.2s;
}

.sidebar-link.external-link:hover .external-icon {
    opacity: 1;
}

/* Content */
.content {
    flex: 1;
    display: flex;
    padding: 18px 15px;
    margin-left: 48px;
    transition: margin-left 0.3s ease;
}

.sidebar.open ~ .content {
    margin-left: 240px;
}

.content-wrapper {
    flex: 1;
    max-width: 100%;
    margin: 0;
    padding: 0 2px;
}

/* Page Header */
.page-header {
    margin-bottom: 10px;
}

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

.page-title {
    font-size: 24px;
    font-weight: 700;
    letter-spacing: -0.025em;
}

.page-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.copy-button {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background-color: transparent;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--foreground);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.copy-button:hover {
    background-color: var(--accent);
    border-color: var(--muted-foreground);
}

.nav-buttons {
    display: flex;
    gap: 8px;
}

.nav-button {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    background-color: transparent;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--foreground);
    text-decoration: none;
    transition: all 0.2s;
}

.nav-button:hover {
    background-color: var(--accent);
    border-color: var(--muted-foreground);
}

.page-description {
    color: var(--muted-foreground);
    font-size: 16px;
    line-height: 1.5;
}

/* Hero Section */
.hero-section {
    flex: 1;
    display: flex;
    align-items: center;
    min-height: calc(100vh - 65px - 60px); /* viewport - header - footer */
    padding: 60px 40px;
}

/* Hide sidebar toggle on main page with hero section */
body:has(.hero-section) .sidebar-toggle {
    display: none;
}

.hero-container {
    max-width: 1400px;
    width: 100%;
    margin: 0 auto;
}

.hero-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 80px;
    align-items: center;
}

.hero-text {
    max-width: 600px;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.hero-title {
    font-size: 56px;
    font-weight: 700;
    line-height: 1.1;
    letter-spacing: -0.03em;
    margin-bottom: 24px;
    color: var(--foreground);
}

.hero-gradient {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 25%, #f093fb 50%, #667eea 75%, #764ba2 100%);
    background-size: 200% 200%;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: gradient 5s ease infinite;
}

@keyframes gradient {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

.hero-description {
    font-size: 18px;
    line-height: 1.6;
    color: var(--muted-foreground);
    margin-bottom: 40px;
}

.hero-start-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 32px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    color: var(--foreground);
    font-size: 14px;
    font-weight: 500;
    letter-spacing: 0.5px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    position: relative;
    overflow: hidden;
    backdrop-filter: blur(10px);
}

.hero-start-button::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, var(--accent), transparent);
    transition: left 0.5s ease;
}

.hero-start-button:hover {
    transform: translateY(-2px) scale(1.02);
    border-color: rgba(255, 255, 255, 0.2);
    background: rgba(255, 255, 255, 0.1);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.2),
                0 0 30px rgba(102, 126, 234, 0.1);
}

.hero-start-button:hover::before {
    left: 100%;
}

.hero-start-button span {
    position: relative;
    z-index: 1;
}

.hero-start-button svg {
    position: relative;
    z-index: 1;
    transition: transform 0.3s ease;
    width: 16px;
    height: 16px;
}

.hero-start-button:hover svg {
    transform: translateX(4px);
}

.hero-start-button:active {
    transform: translateY(0);
}

.hero-video {
    position: relative;
    width: 100%;
    height: 500px;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.hero-video-player {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Video Sound Toggle Button */
.video-sound-toggle {
    position: absolute;
    bottom: 20px;
    right: 20px;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: rgba(20, 20, 20, 0.8);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
    z-index: 10;
}

.video-sound-toggle:hover {
    background: rgba(102, 126, 234, 0.9);
    border-color: rgba(102, 126, 234, 0.5);
    transform: scale(1.1);
}

.video-sound-toggle svg {
    width: 20px;
    height: 20px;
}

/* Responsive Design */
@media (max-width: 1024px) {
    .hero-content {
        grid-template-columns: 1fr;
        gap: 40px;
    }

    .hero-title {
        font-size: 48px;
    }

    .hero-video {
        height: 400px;
    }
}

@media (max-width: 768px) {
    .hero-section {
        padding: 40px 20px;
    }

    .hero-title {
        font-size: 36px;
    }

    .hero-description {
        font-size: 16px;
    }

    .hero-video {
        height: 300px;
    }
}

/* Components Grid */
.components-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    margin-bottom: 48px;
}

.component-card {
    padding: 12px 16px;
    background-color: transparent;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--foreground);
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s;
}

.component-card:hover {
    background-color: var(--accent);
    border-color: var(--muted-foreground);
}

/* Page Navigation */
.page-navigation {
    display: flex;
    justify-content: space-between;
    padding-top: 48px;
    border-top: 1px solid var(--border);
}

.page-nav-link {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 16px;
    text-decoration: none;
    color: var(--muted-foreground);
    font-size: 14px;
    font-weight: 500;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    transition: all 0.2s;
}

.page-nav-link:hover {
    color: var(--foreground);
    background-color: var(--accent);
    border-color: var(--muted-foreground);
}

.page-nav-link.prev {
    flex-direction: row;
}

.page-nav-link.next {
    flex-direction: row;
    margin-left: auto;
}


/* Stage Selection Section - Content */
.stage-section-content {
    margin-top: 80px;
    position: relative;
    min-height: calc(100vh - 300px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 60px 20px 40px;
}

/* START 페이지 전체 콘텐츠 배경 이미지 */
.start-page-wrapper {
    position: relative;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.start-page-wrapper::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: url('../assets/images/start.png');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    opacity: 1;
    z-index: 0;
    pointer-events: none;
}

.start-page-wrapper .page-header,
.start-page-wrapper .stage-section-content {
    position: relative;
    z-index: 1;
}

/* START 페이지 텍스트 가독성 개선 */
.start-page-wrapper .page-header {
    text-align: left;
    padding-left: 20px;
    padding-top: 20px;
}

.start-page-wrapper .page-title {
    color: #ffffff;
    text-shadow:
        3px 3px 6px rgba(0, 0, 0, 1),
        -1px -1px 3px rgba(0, 0, 0, 0.8),
        0 0 30px rgba(0, 0, 0, 0.9);
    font-weight: 700;
    letter-spacing: 2px;
    background: transparent;
    padding: 0;
    display: block;
    margin: 0 0 2px 0;
    text-align: left;
}

.start-page-wrapper .page-description {
    color: #ffffff;
    text-shadow:
        2px 2px 4px rgba(0, 0, 0, 1),
        0 0 20px rgba(0, 0, 0, 0.9);
    font-weight: 500;
    background: transparent;
    padding: 0;
    display: block;
    margin-top: 0;
    text-align: left;
}

/* Stage Selection Section - Full Page */
.stage-section {
    flex: 1;
    display: flex;
    align-items: center;
    min-height: calc(100vh - 65px - 60px);
    padding: 60px 40px;
}

.stage-container {
    max-width: 1200px;
    width: 100%;
    margin: 0 auto;
}

.stage-header {
    text-align: center;
    margin-bottom: 60px;
}

.stage-title {
    font-size: 48px;
    font-weight: 700;
    letter-spacing: -0.025em;
    margin-bottom: 16px;
    color: var(--foreground);
}

.stage-description {
    font-size: 18px;
    color: var(--muted-foreground);
}

.stage-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
    margin-bottom: 60px;
    position: relative;
    z-index: 1;
}

/* START 페이지의 2개 카드 레이아웃 */
.stage-grid[style*="repeat(2, 1fr)"] {
    grid-template-columns: repeat(2, 1fr) !important;
    max-width: 1100px !important;
    margin: 60px auto 60px !important;
}

.stage-grid[style*="repeat(2, 1fr)"] .stage-card {
    min-height: 100px;
    max-height: 120px;
    min-width: 400px;
    padding: 18px 20px;
}

/* START 페이지 스테이지 카드 스타일 개선 */
.start-page-wrapper .stage-card {
    background: linear-gradient(135deg, rgba(25, 25, 25, 0.98), rgba(35, 35, 35, 0.95));
    backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 20px;
    position: relative;
    overflow: visible;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    padding: 20px 20px;
}

/* 호버 시 상단 줄 효과 제거 */

.start-page-wrapper .stage-card:hover {
    background: linear-gradient(135deg, rgba(35, 35, 35, 0.98), rgba(45, 45, 45, 0.95));
    border-color: rgba(255, 107, 107, 0.4);
    transform: translateY(-4px) scale(1.02);
    box-shadow:
        0 20px 40px rgba(0, 0, 0, 0.6),
        0 0 60px rgba(255, 107, 107, 0.1);
}

/* START 페이지 카드 내부 레이아웃 수정 */
.start-page-wrapper .stage-number {
    flex-shrink: 0;
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    font-weight: 700;
    background: linear-gradient(135deg, rgba(255, 107, 107, 0.2), rgba(107, 255, 255, 0.1));
    border-radius: 10px;
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.start-page-wrapper .stage-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 6px;
    min-width: 0;
}

.start-page-wrapper .stage-name {
    font-size: 18px;
    font-weight: 600;
    margin: 0;
    white-space: nowrap;
    display: flex;
    align-items: center;
    color: #ffffff;
    gap: 6px;
}

.start-page-wrapper .stage-name svg {
    width: 16px;
    height: 16px;
    opacity: 0.7;
    transition: all 0.3s ease;
    flex-shrink: 0;
}

.start-page-wrapper .stage-card:hover .stage-name svg {
    opacity: 1;
    transform: translate(2px, -2px);
}

.start-page-wrapper .stage-info {
    font-size: 13px;
    margin: 0;
    color: rgba(255, 255, 255, 0.6);
    letter-spacing: 0.2px;
    line-height: 1.3;
}

.start-page-wrapper .stage-status {
    margin-left: auto;
    flex-shrink: 0;
}

.start-page-wrapper .status-badge {
    display: inline-flex;
    align-items: center;
    padding: 8px 18px;
    background: linear-gradient(135deg, rgba(255, 107, 107, 0.9), rgba(255, 140, 140, 0.9));
    color: white;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 0.3px;
    transition: all 0.3s ease;
    box-shadow: 0 3px 12px rgba(255, 107, 107, 0.3);
    white-space: nowrap;
}

.start-page-wrapper .stage-card:hover .status-badge {
    background: linear-gradient(135deg, rgba(255, 107, 107, 1), rgba(255, 140, 140, 1));
    transform: scale(1.05);
    box-shadow: 0 6px 20px rgba(255, 107, 107, 0.5);
}

.stage-card {
    position: relative;
    display: flex;
    flex-direction: column;
    padding: 32px;
    background: var(--card);
    border: 2px solid var(--border);
    border-radius: 16px;
    text-decoration: none;
    transition: all 0.3s ease;
    overflow: hidden;
}

.stage-card:hover {
    transform: translateY(-4px);
    border-color: #667eea;
    box-shadow: 0 12px 40px rgba(102, 126, 234, 0.2);
}

.stage-number {
    font-size: 48px;
    font-weight: 700;
    color: rgba(102, 126, 234, 0.3);
    margin-bottom: 0px;
    line-height: 1;
}

.stage-content {
    flex: 1;
}

.stage-name {
    font-size: 24px;
    font-weight: 600;
    color: var(--foreground);
    margin-bottom: 8px;
}

.stage-info {
    font-size: 14px;
    color: var(--muted-foreground);
    line-height: 1.5;
}

.stage-status {
    margin-top: 20px;
}

.status-badge {
    display: inline-block;
    padding: 6px 12px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    font-size: 12px;
    font-weight: 600;
    border-radius: 20px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.status-badge.locked {
    background: var(--muted);
    color: var(--muted-foreground);
}

.stage-footer {
    text-align: center;
}

.back-button {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    background: transparent;
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--muted-foreground);
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s ease;
}

.back-button:hover {
    background: var(--accent);
    border-color: var(--muted-foreground);
    color: var(--foreground);
}

/* Responsive Design for Stage Grid */
@media (max-width: 1024px) {
    .stage-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .stage-grid[style*="repeat(2, 1fr)"] {
        grid-template-columns: 1fr !important;
        max-width: 600px !important;
    }

    .stage-grid[style*="repeat(2, 1fr)"] .stage-card {
        min-width: unset;
        width: 100%;
    }
}

@media (max-width: 640px) {
    .stage-grid {
        grid-template-columns: 1fr;
    }

    .stage-title {
        font-size: 36px;
    }

    .stage-section {
        padding: 40px 20px;
    }
}

/* Image Viewer Modal */
.image-viewer-modal {
    display: none;
    position: fixed;
    z-index: 9999;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.95);
    justify-content: center;
    align-items: center;
    flex-direction: column;
    padding: 20px;
}

.image-viewer-modal img {
    max-width: 90%;
    max-height: 80%;
    object-fit: contain;
    border-radius: 8px;
}

.image-viewer-modal .modal-close {
    position: absolute;
    top: 20px;
    right: 35px;
    color: #f1f1f1;
    font-size: 40px;
    font-weight: bold;
    cursor: pointer;
    transition: 0.3s;
}

.image-viewer-modal .modal-close:hover {
    color: #ff6b6b;
}

.modal-controls {
    margin-top: 20px;
    display: flex;
    gap: 16px;
    align-items: center;
}

.modal-controls .btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

/* Footer */
.footer {
    border-top: 1px solid var(--border);
    padding: 32px 0;
}

.footer-content {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 24px;
    text-align: center;
    color: var(--muted-foreground);
    font-size: 14px;
}

.footer-link {
    color: var(--foreground);
    text-decoration: underline;
    text-underline-offset: 4px;
}

/* Scrollbar Styles */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

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

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

::-webkit-scrollbar-thumb:hover {
    background-color: var(--muted-foreground);
}

/* Mobile Bottom Navigation */
.mobile-nav {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 60px;
    background: rgba(20, 20, 20, 0.98);
    border-top: 1px solid rgba(255, 107, 107, 0.2);
    backdrop-filter: blur(10px);
    z-index: 1000;
    padding: 0 8px;
}

.mobile-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    color: var(--muted-foreground);
    text-decoration: none;
    font-size: 10px;
    font-weight: 500;
    transition: all 0.2s ease;
    padding: 6px 12px;
    border-radius: 8px;
    position: relative;
}

.mobile-nav-item svg {
    width: 20px;
    height: 20px;
    stroke-width: 1.5;
}

.mobile-nav-item span {
    font-size: 11px;
    margin-top: 2px;
}

.mobile-nav-item:active {
    transform: scale(0.95);
}

.mobile-nav-item.active {
    color: #fff;
}

.mobile-nav-item.active::before {
    content: '';
    position: absolute;
    top: -1px;
    left: 50%;
    transform: translateX(-50%);
    width: 40px;
    height: 3px;
    background: linear-gradient(90deg, transparent, rgba(255, 107, 107, 0.8), transparent);
    border-radius: 0 0 3px 3px;
}

.mobile-nav-item:hover:not(.active) {
    background: rgba(255, 107, 107, 0.1);
    color: rgba(255, 107, 107, 0.8);
}

/* Mobile Menu Overlay */
.mobile-menu-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(5px);
    z-index: 9999;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.mobile-menu-overlay.active {
    opacity: 1;
    visibility: visible;
}

.mobile-menu {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(20, 20, 20, 0.98);
    border-top: 1px solid rgba(255, 107, 107, 0.2);
    border-radius: 20px 20px 0 0;
    padding: 20px;
    transform: translateY(100%);
    transition: transform 0.3s ease;
    max-height: 70vh;
    overflow-y: auto;
}

.mobile-menu-overlay.active .mobile-menu {
    transform: translateY(0);
}

.mobile-menu-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid rgba(255, 107, 107, 0.1);
}

.mobile-menu-header h2 {
    font-size: 20px;
    font-weight: 600;
    color: #fff;
}

.mobile-menu-close {
    background: none;
    border: none;
    color: var(--muted-foreground);
    cursor: pointer;
    padding: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    transition: all 0.2s ease;
}

.mobile-menu-close:hover {
    background: rgba(255, 107, 107, 0.1);
    color: rgba(255, 107, 107, 0.8);
}

.mobile-menu-content {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.mobile-menu-link {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 16px;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 107, 107, 0.1);
    border-radius: 12px;
    color: #fff;
    text-decoration: none;
    font-size: 15px;
    font-weight: 500;
    transition: all 0.2s ease;
}

.mobile-menu-link:hover {
    background: rgba(255, 107, 107, 0.1);
    border-color: rgba(255, 107, 107, 0.3);
    transform: translateX(4px);
}

.mobile-menu-divider {
    height: 1px;
    background: rgba(255, 107, 107, 0.1);
    margin: 12px 0;
}

.mobile-menu-theme {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 16px;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 107, 107, 0.1);
    border-radius: 12px;
    color: #fff;
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    width: 100%;
    text-align: left;
}

.mobile-menu-theme:hover {
    background: rgba(255, 107, 107, 0.1);
    border-color: rgba(255, 107, 107, 0.3);
}

/* Concept Art Page Styles */
.control-panel {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 10px;
    margin-bottom: 10px;
    position: relative;
}

.section-title {
    font-size: 24px;
    font-weight: 700;
    color: var(--foreground);
    margin-bottom: 8px;
}

.section-subtitle {
    font-size: 14px;
    color: var(--muted-foreground);
    margin-bottom: 24px;
}

.category-controls {
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: nowrap;
    padding-right: 60px; /* Space for absolute positioned buttons */
    min-height: 40px; /* Ensure minimum height for vertical centering */
}

/* Dropdown Styles */
.dropdown-container {
    position: relative;
    display: inline-block;
    flex-shrink: 0;
}

.dropdown-button {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    background: var(--secondary);
    color: var(--foreground);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s ease;
}

body:not(.dark) .dropdown-button {
    background: white;
    border: 1px solid #d1d5db;
    color: #374151;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

.dropdown-button:hover {
    background: var(--accent);
    border-color: var(--ring);
}

body:not(.dark) .dropdown-button:hover {
    background: #f9fafb;
    border-color: #6366f1;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.12);
}

.dropdown-content {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    margin-top: 4px;
    background: var(--popover);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    min-width: 180px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    z-index: 100;
}

body:not(.dark) .dropdown-content {
    background: white;
    border: 1px solid #d1d5db;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.dropdown-content.show {
    display: block;
}

.dropdown-item {
    padding: 10px 16px;
    cursor: pointer;
    font-size: 14px;
    color: var(--foreground);
    transition: background 0.2s ease;
}

body:not(.dark) .dropdown-item {
    color: #374151;
    font-weight: 500;
}

.dropdown-item:hover {
    background: var(--accent);
}

body:not(.dark) .dropdown-item:hover {
    background: #f3f4f6;
}

.dropdown-item.active {
    background: var(--primary);
    color: var(--primary-foreground);
}

body:not(.dark) .dropdown-item.active {
    background: #6366f1;
    color: white;
    font-weight: 600;
}

/* Action Buttons */
.action-buttons {
    position: absolute;
    top: 50%;
    right: 24px;
    transform: translateY(-50%);
    display: flex;
    gap: 16px;
    align-items: flex-start;
}

/* Button Groups */
.button-group {
    background: rgba(0, 0, 0, 0.02);
    border: 1px solid rgba(0, 0, 0, 0.08);
    border-radius: 8px;
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

body.dark .button-group {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.button-group:hover {
    background: rgba(0, 0, 0, 0.04);
    border-color: rgba(0, 0, 0, 0.12);
    transition: all 0.2s ease;
}

body.dark .button-group:hover {
    background: rgba(255, 255, 255, 0.04);
    border-color: rgba(255, 255, 255, 0.08);
}

.group-label {
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: rgba(0, 0, 0, 0.6);
    margin-bottom: 4px;
}

body.dark .group-label {
    color: rgba(255, 255, 255, 0.4);
}

.group-controls {
    display: flex;
    gap: 8px;
    align-items: center;
}

/* Section Select Styling */
.section-select {
    padding: 6px 10px;
    border-radius: 6px;
    background: var(--secondary);
    color: var(--foreground);
    border: 1px solid var(--border);
    font-size: 12px;
    height: 32px;
    cursor: pointer;
    transition: all 0.2s ease;
}

body:not(.dark) .section-select {
    background: white;
    border: 1px solid #d1d5db;
    color: #374151;
    font-weight: 500;
}

.section-select:hover {
    background: var(--muted);
    border-color: rgba(255, 255, 255, 0.2);
}

body:not(.dark) .section-select:hover {
    background: #f9fafb;
    border-color: #9ca3af;
}

.section-select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.1);
}

body:not(.dark) .section-select:focus {
    border-color: #6366f1;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15);
}

/* Specific styles for action buttons to prevent conflicts */
.action-buttons .btn {
    min-width: 70px !important;
    height: 32px !important;
    line-height: 20px !important;
    padding: 6px 10px !important;
    font-size: 12px !important;
    width: auto;
    vertical-align: middle;
    box-sizing: border-box;
    margin: 0 !important;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.action-buttons .btn svg {
    flex-shrink: 0;
}

.action-buttons .btn span {
    white-space: nowrap;
}

.btn {
    padding: 8px 16px;
    border: none;
    border-radius: var(--radius);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    min-width: 100px;
    height: 36px;
    line-height: 20px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    white-space: nowrap;
    flex-shrink: 0;
    vertical-align: middle;
    box-sizing: border-box;
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: 1px solid transparent;
    margin: 0;
}

body:not(.dark) .btn-primary {
    background: linear-gradient(135deg, #5b63d3 0%, #6b42a0 100%);
    box-shadow: 0 2px 4px rgba(102, 126, 234, 0.2);
}

.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

body:not(.dark) .btn-primary:hover {
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.btn-secondary {
    background: var(--secondary);
    color: var(--foreground);
    border: 1px solid var(--border);
    margin: 0;
}

body:not(.dark) .btn-secondary {
    background: #f3f4f6;
    border: 1px solid #d1d5db;
    color: #374151;
    font-weight: 500;
}

.btn-secondary:hover {
    background: var(--accent);
    border-color: var(--accent);
}

body:not(.dark) .btn-secondary:hover {
    background: #e5e7eb;
    border-color: #9ca3af;
    transform: translateY(-1px);
}

.btn-accent {
    background: #ef4444;
    color: white;
    border: 1px solid transparent;
    margin: 0;
}

.btn-accent:hover {
    background: #dc2626;
    transform: translateY(-1px);
}

.btn-success {
    background: rgba(52, 211, 153, 0.15);
    border: 1px solid rgba(52, 211, 153, 0.3);
    color: #34d399;
}

body:not(.dark) .btn-success {
    background: #10b981;
    border: 1px solid #059669;
    color: white;
    font-weight: 500;
}

.btn-success:hover {
    background: rgba(52, 211, 153, 0.25);
    border-color: rgba(52, 211, 153, 0.5);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(52, 211, 153, 0.2);
}

body:not(.dark) .btn-success:hover {
    background: #059669;
    border-color: #047857;
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
}

.btn-danger {
    background: rgba(239, 68, 68, 0.15);
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: #ef4444;
}

body:not(.dark) .btn-danger {
    background: #ef4444;
    border: 1px solid #dc2626;
    color: white;
    font-weight: 500;
}

.btn-danger:hover {
    background: rgba(239, 68, 68, 0.25);
    border-color: rgba(239, 68, 68, 0.5);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.2);
}

body:not(.dark) .btn-danger:hover {
    background: #dc2626;
    border-color: #b91c1c;
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.3);
}

/* Main Content Area */
.main-content-area {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 24px;
    margin-top: 32px;
}

/* Prompt Section */
.prompt-section {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 24px;
}

.section-header {
    font-size: 18px;
    font-weight: 600;
    color: var(--foreground);
    margin-bottom: 20px;
}

/* Data Table */
.data-table {
    width: 100%;
    border-collapse: collapse;
}

.data-table th {
    background: var(--secondary);
    padding: 12px;
    text-align: left;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    color: var(--muted-foreground);
    border: 1px solid var(--border);
}

.data-table td {
    padding: 8px 12px;
    border: 1px solid var(--border);
}

.data-table .label {
    font-size: 12px;
    font-weight: 600;
    color: var(--muted-foreground);
    background: var(--muted);
    width: 120px;
}

.input-field, .textarea-field {
    width: 100%;
    padding: 8px 12px;
    background: var(--background);
    border: 1px solid var(--border);
    border-radius: 4px;
    color: var(--foreground);
    font-size: 13px;
    transition: border-color 0.2s ease;
}

.input-field:focus, .textarea-field:focus {
    outline: none;
    border-color: var(--ring);
}

.textarea-field {
    resize: vertical;
    min-height: 50px;
    font-family: inherit;
}

/* Prompt Output */
.prompt-output {
    margin-top: 24px;
    padding: 20px;
    background: var(--muted);
    border-radius: var(--radius);
}

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

.output-header h4 {
    font-size: 14px;
    font-weight: 600;
    color: var(--foreground);
}

/* Prompt Actions Container */
.prompt-actions {
    display: flex;
    gap: 6px;
    margin-top: 10px;
    justify-content: flex-end;
    align-items: center;
}

/* Generate Button */
.generate-btn {
    background: rgba(102, 126, 234, 0.3);
    border: 1px solid rgba(102, 126, 234, 0.3);
    color: rgba(255, 255, 255, 0.9);
    border-radius: var(--radius);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 5px 10px;
    transition: all 0.2s ease;
    font-size: 11px;
    min-width: auto;
    height: 28px;
    justify-content: center;
    backdrop-filter: blur(4px);
}

body:not(.dark) .generate-btn {
    background: #6366f1;
    border: 1px solid #4f46e5;
    color: white;
    font-weight: 600;
    box-shadow: 0 1px 3px rgba(99, 102, 241, 0.3);
}

.generate-btn:hover:not(:disabled) {
    background: rgba(102, 126, 234, 0.4);
    border-color: rgba(102, 126, 234, 0.5);
    transform: translateY(-1px);
    color: rgba(255, 255, 255, 1);
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.3);
}

body:not(.dark) .generate-btn:hover:not(:disabled) {
    background: #4f46e5;
    border-color: #4338ca;
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.4);
}

.generate-btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

/* Edit button - same style as generate button but different color */
.edit-btn {
    background: rgba(52, 211, 153, 0.3);  /* Green color */
    border: 1px solid rgba(52, 211, 153, 0.3);
    color: rgba(255, 255, 255, 0.9);
    border-radius: var(--radius);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 5px 10px;
    transition: all 0.2s ease;
    font-size: 13px;
    font-weight: 500;
}

body:not(.dark) .edit-btn {
    background: #10b981;
    border: 1px solid #059669;
    color: white;
    font-weight: 600;
    box-shadow: 0 1px 3px rgba(16, 185, 129, 0.3);
}

.edit-btn:hover:not(:disabled) {
    background: rgba(52, 211, 153, 0.4);
    border-color: rgba(52, 211, 153, 0.5);
    transform: translateY(-1px);
    color: rgba(255, 255, 255, 1);
    box-shadow: 0 2px 8px rgba(52, 211, 153, 0.3);
}

body:not(.dark) .edit-btn:hover:not(:disabled) {
    background: #059669;
    border-color: #047857;
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.4);
}

.edit-btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

/* Animation for spinner */
@keyframes spin {
    to { transform: rotate(360deg); }
}

.animate-spin {
    animation: spin 1s linear infinite;
}

.copy-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background: var(--primary);
    color: var(--primary-foreground);
    border: none;
    border-radius: 4px;
    font-size: 12px;
    cursor: pointer;
    transition: opacity 0.2s ease;
}

.copy-btn:hover {
    opacity: 0.8;
}

.prompt-display {
    padding: 16px;
    background: var(--background);
    border: 1px solid var(--border);
    border-radius: 4px;
    font-size: 12px;
    line-height: 1.8;
    color: var(--foreground);
    font-family: 'Monaco', 'Courier New', monospace;
    letter-spacing: 0.3px;
    white-space: pre-wrap;
    word-break: break-word;
}

body:not(.dark) .prompt-display {
    background: #f9fafb;
    border: 1px solid #d1d5db;
    color: #1f2937;
    font-weight: 500;
}

/* Image Section */
.image-section {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 24px;
}

.image-upload {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
    align-items: stretch;
}

.image-upload .btn.btn-primary {
    padding: 6px 10px !important;
    font-size: 12px !important;
    width: 100px !important;
    min-width: 100px !important;
    max-width: 100px !important;
    height: 32px !important;
    margin: 0;
    flex-shrink: 0;
    flex: none !important;
}

.url-input {
    flex: 1;
    padding: 6px 12px;
    background: var(--background);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--foreground);
    font-size: 13px;
    height: 32px;
}

.url-input:focus {
    outline: none;
    border-color: var(--ring);
}

.image-grid {
    display: flex;
    flex-direction: column;
    gap: 12px;
    max-height: 600px;
    overflow-y: auto;
    padding: 4px;
}

.image-item {
    position: relative;
    border-radius: var(--radius);
    overflow: hidden;
    border: 1px solid var(--border);
    background: var(--card);
    width: 100%;
    max-width: 100%;
}

.image-item img {
    width: 100%;
    height: auto;
    display: block;
    cursor: pointer;
    transition: transform 0.2s;
}

.image-item:hover img {
    transform: scale(1.05);
}

/* Image Controls Container */
.image-controls {
    position: absolute;
    top: 8px;
    right: 8px;
    display: flex;
    gap: 4px;
    opacity: 0;
    transition: opacity 0.2s;
}

.image-item:hover .image-controls {
    opacity: 1;
}

/* Control Buttons Base Style */
.control-btn {
    width: 32px;
    height: 32px;
    border: none;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
    color: white;
}

/* Save Button */
.control-btn.save-btn {
    background: rgba(34, 197, 94, 0.9);
}

.control-btn.save-btn:hover:not(:disabled) {
    background: rgba(34, 197, 94, 1);
}

.control-btn.save-btn.saved {
    background: rgba(59, 130, 246, 0.9);
    cursor: default;
}

/* Download Button */
.control-btn.download-btn {
    background: rgba(139, 92, 246, 0.9);
}

.control-btn.download-btn:hover {
    background: rgba(139, 92, 246, 1);
}

/* Delete Button */
.control-btn.delete-btn {
    background: rgba(239, 68, 68, 0.9);
    font-size: 20px;
    font-weight: bold;
}

.control-btn.delete-btn:hover {
    background: rgba(239, 68, 68, 1);
}

/* Keep old delete-btn style for backward compatibility */
.image-item .delete-btn {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 24px;
    height: 24px;
    background: rgba(239, 68, 68, 0.9);
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.image-item:hover .delete-btn {
    opacity: 1;
}

.image-placeholder {
    grid-column: 1 / -1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 48px;
    border: 2px dashed var(--border);
    border-radius: var(--radius);
    color: var(--muted-foreground);
    text-align: center;
}

.image-placeholder p {
    margin-top: 12px;
    font-size: 14px;
}

/* Universal Prompts */
.universal-prompts {
    margin-bottom: 32px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.universal-prompt-item {
    position: relative;
    padding: 16px;
    background: var(--muted);
    border-radius: var(--radius);
}

.universal-prompt-item label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    color: var(--muted-foreground);
    margin-bottom: 8px;
    text-transform: uppercase;
}

.universal-prompt-item .prompt-display {
    margin-bottom: 12px;
    min-height: 100px;
    max-height: 250px;
    overflow-y: auto;
}

/* Scrollbar styling for prompt-display */
.prompt-display::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

.prompt-display::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
}

.prompt-display::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.5);
    border-radius: 4px;
}

.prompt-display::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.7);
}

/* Firefox scrollbar styling */
.prompt-display {
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.5) rgba(255, 255, 255, 0.1);
}

.universal-prompt-item .copy-btn {
    position: absolute;
    top: 16px;
    right: 16px;
}

/* Responsive Design for Concept Art */
@media (max-width: 1024px) {
    .main-content-area {
        grid-template-columns: 1fr;
    }

    .category-controls {
        flex-direction: row;
        flex-wrap: wrap;
        padding-right: 16px;
        min-height: auto;
    }

    .action-buttons {
        position: relative;
        top: auto;
        right: auto;
        transform: none;
        display: flex;
        flex-direction: column;
        width: 100%;
        gap: 12px;
        margin-top: 12px;
    }

    .button-group {
        width: 100%;
    }

    .group-controls {
        flex-wrap: wrap;
    }

    .action-buttons .btn {
        min-width: 90px !important;
        font-size: 12px !important;
        padding: 6px 12px !important;
        height: 32px !important;
    }
}

@media (max-width: 768px) {
    .content-wrapper {
        padding: 0 8px;
    }

    .control-panel {
        padding: 16px;
    }

    .section-title {
        font-size: 20px;
    }

    .prompt-section, .image-section {
        padding: 16px;
    }

    .data-table {
        font-size: 12px;
    }

    .data-table th, .data-table td {
        padding: 6px 8px;
    }

    .image-grid {
        max-height: 400px;
    }

    .image-item {
        width: 100%;
        max-width: 100%;
    }

    .dropdown-container {
        width: 100%;
    }

    .dropdown-button {
        width: 100%;
        justify-content: space-between;
    }

    .dropdown-content {
        width: 100%;
    }

    .action-buttons {
        display: flex;
        flex-direction: row;
        justify-content: center;
        gap: 3px;
        width: 100%;
        margin-top: 10px;
    }

    .action-buttons .btn {
        min-width: 75px !important;
        padding: 5px 8px !important;
        font-size: 11px !important;
        height: 28px !important;
        flex: 1;
        max-width: 110px;
    }

    .image-upload .btn.btn-primary {
        width: 100px !important;
        min-width: 100px !important;
        max-width: 100px !important;
        align-self: flex-start;
        padding: 8px 12px;
        font-size: 13px;
        flex: none !important;
    }
}

/* Responsive Design */
@media (max-width: 1280px) {
    .sidebar.open ~ .content {
        margin-left: 240px;
    }
}

@media (max-width: 768px) {
    .mobile-nav {
        display: flex;
        align-items: center;
        justify-content: space-around;
    }

    .content {
        margin-left: 0;
    }

    /* Adjust body padding for mobile nav */
    body {
        padding-bottom: 60px;
    }

    /* Hide desktop footer on mobile when nav is present */
    .footer {
        margin-bottom: 60px;
    }

    /* Adjust hero section for mobile nav */
    .hero-section {
        min-height: calc(100vh - 65px - 60px);
    }

    /* Adjust stage section for mobile nav */
    .stage-section {
        min-height: calc(100vh - 65px - 120px);
        padding-bottom: 80px;
    }
    .sidebar {
        left: -240px;
    }

    .sidebar.open ~ .content {
        margin-left: 0;
    }

    .components-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .search-button {
        min-width: auto;
        width: auto;
    }

    .search-button span:first-child {
        display: none;
    }

    .main-nav {
        display: none;
    }
}

@media (max-width: 480px) {
    .components-grid {
        grid-template-columns: 1fr;
    }

    .page-title {
        font-size: 28px;
    }

    .header-content {
        padding: 0 16px;
    }

    .content {
        padding: 16px 8px !important;
        margin-left: 0 !important;
    }
}

/* Concept Art Page - Compact Copy Button */
.copy-btn-compact {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 5px 10px;
    background: rgba(60, 60, 60, 0.3);
    border: 1px solid rgba(100, 100, 100, 0.2);
    border-radius: var(--radius);
    color: rgba(255, 255, 255, 0.7);
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 11px;
    min-width: auto;
    height: 28px;
    justify-content: center;
    backdrop-filter: blur(4px);
}

body:not(.dark) .copy-btn-compact {
    background: #6b7280;
    border: 1px solid #4b5563;
    color: white;
    font-weight: 600;
    box-shadow: 0 1px 3px rgba(107, 114, 128, 0.3);
}

.copy-btn-compact:hover {
    background: rgba(80, 80, 80, 0.4);
    border-color: rgba(120, 120, 120, 0.3);
    transform: translateY(-1px);
    color: rgba(255, 255, 255, 0.9);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

body:not(.dark) .copy-btn-compact:hover {
    background: #4b5563;
    border-color: #374151;
    box-shadow: 0 4px 12px rgba(107, 114, 128, 0.4);
}

.copy-btn-compact:active {
    transform: translateY(0);
    background: rgba(70, 70, 70, 0.5);
}

.copy-btn-compact svg {
    width: 14px;
    height: 14px;
    opacity: 0.8;
}

.universal-prompts {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.universal-prompt-item {
    display: flex;
    flex-direction: column;
    align-items: stretch;
}

/* 프롬프트 수정 모달 스타일 */
.prompt-edit-modal {
    display: none;
    position: fixed;
    z-index: 10000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    justify-content: center;
    align-items: center;
}

.prompt-edit-content {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    width: 90%;
    max-width: 600px;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
}

.prompt-edit-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border);
}

.prompt-edit-header h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
    color: var(--foreground);
}

.prompt-edit-body {
    padding: 20px;
    max-height: 500px;
    overflow-y: auto;
    flex: 1;
}

.prompt-fields-container {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.prompt-field-row {
    display: grid;
    grid-template-columns: 150px 1fr;
    gap: 12px;
    align-items: center;
}

.prompt-field-label {
    font-size: 11px;
    font-weight: 600;
    color: var(--muted-foreground);
    text-align: right;
    font-family: 'Monaco', 'Courier New', monospace;
    letter-spacing: 0.5px;
}

.prompt-field-input {
    width: 100%;
    padding: 8px 12px;
    background: var(--background);
    border: 1px solid var(--border);
    border-radius: 4px;
    color: var(--foreground);
    font-family: 'Monaco', 'Courier New', monospace;
    font-size: 12px;
    line-height: 1.4;
    transition: all 0.2s ease;
}

.prompt-field-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.1);
    background: var(--card);
}

.prompt-field-input::placeholder {
    color: var(--muted-foreground);
    opacity: 0.5;
    font-size: 11px;
}

.prompt-edit-textarea {
    width: 100%;
    padding: 16px;
    background: var(--background);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--foreground);
    font-family: 'Monaco', 'Courier New', monospace;
    font-size: 12px;
    line-height: 1.8;
    letter-spacing: 0.3px;
    white-space: pre-wrap;
    word-break: break-word;
    resize: vertical;
    min-height: 200px;
}

.prompt-edit-textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.1);
}

.prompt-edit-footer {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding: 16px 20px;
    border-top: 1px solid var(--border);
}

/* 드래그 앤 드롭 스타일 */
.image-upload {
    position: relative;
    transition: all 0.3s ease;
}

.image-upload.drag-over {
    transform: scale(1.02);
}

.url-input {
    transition: all 0.3s ease;
}

/* 업로드 토스트 애니메이션 */
@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes slideOut {
    from {
        transform: translateX(0);
        opacity: 1;
    }
    to {
        transform: translateX(100%);
        opacity: 0;
    }
}

.upload-toast {
    font-family: 'Inter', sans-serif;
    font-weight: 500;
    font-size: 14px;
}

/* 드래그 오버 시 입력창 스타일 */
.image-upload.drag-over .url-input {
    border-style: dashed !important;
    border-width: 2px !important;
    animation: pulse 1.5s infinite;
}

@keyframes pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(255, 107, 107, 0.4);
    }
    70% {
        box-shadow: 0 0 0 10px rgba(255, 107, 107, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(255, 107, 107, 0);
    }
}

/* Three Column Layout for Prompts */
.prompt-three-columns {
    display: grid;
    grid-template-columns: 200px 1fr 300px;
    gap: 20px;
    margin-top: 20px;
    height: 100%;
}

.prompt-column {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px;
    overflow-y: auto;
}

.column-header {
    font-size: 14px;
    font-weight: 600;
    color: var(--primary);
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--border);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Labels Column */
.labels-column {
    padding: 15px;
}

.label-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.label-item {
    padding: 10px 15px;
    background: var(--background);
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 13px;
    font-weight: 500;
    color: var(--foreground);
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
}

.label-item:hover {
    background: rgba(139, 92, 246, 0.1);
    border-color: var(--primary);
    transform: translateX(5px);
}

.label-item.active {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
    box-shadow: 0 2px 8px rgba(139, 92, 246, 0.3);
}

.label-item.active::after {
    content: '→';
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
}

/* Prompt Content Column */
.prompt-content-column {
    padding: 20px;
}

.prompt-blocks {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.prompt-block {
    display: none;
}

.prompt-block.active {
    display: block;
}

.prompt-field {
    position: relative;
    display: flex;
    align-items: center;
    gap: 10px;
}

.prompt-input {
    flex: 1;
    padding: 12px 40px 12px 15px;
    background: var(--background);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--foreground);
    font-size: 14px;
    transition: all 0.2s ease;
}

.prompt-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.1);
}

.clear-btn {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    width: 24px;
    height: 24px;
    border: none;
    background: var(--muted);
    color: var(--foreground);
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    line-height: 1;
    transition: all 0.2s ease;
}

.clear-btn:hover {
    background: var(--destructive);
    color: white;
    transform: translateY(-50%) scale(1.1);
}

.combined-prompt-section {
    margin-top: 30px;
    padding-top: 20px;
    border-top: 2px solid var(--border);
}

.combined-prompt-section label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--primary);
    margin-bottom: 10px;
    text-transform: uppercase;
}

/* Translation Column */
.translation-column {
    padding: 20px;
}

.change-request-section {
    margin-bottom: 20px;
}

.change-request-input {
    width: 100%;
    min-height: 100px;
    padding: 12px;
    background: var(--background);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--foreground);
    font-size: 14px;
    resize: vertical;
    transition: all 0.2s ease;
}

.change-request-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.1);
}

.apply-change-btn {
    width: 100%;
    margin-top: 10px;
    padding: 10px;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.apply-change-btn:hover {
    background: var(--primary-hover);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(139, 92, 246, 0.3);
}

.translation-section {
    background: var(--background);
    padding: 15px;
    border-radius: 8px;
    border: 1px solid var(--border);
}

.translate-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.translate-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.voice-style-section {
    background: var(--background);
    padding: 15px;
    border-radius: 8px;
    border: 1px solid var(--border);
    margin-top: 20px;
}

/* Hide Gallery Section - sidebar and mobile navigation */
.sidebar-section:has(a[href*="gallery"]) {
    display: none !important;
}

a.mobile-nav-item[href*="gallery"] {
    display: none !important;
}
