:root {
    /* Color Palette - Modern & Minimal */
    --bg-primary: #ffffff;
    --bg-secondary: #f8f9fa;
    --text-primary: #121212;
    --text-secondary: #6c757d;
    --accent: #2c3e50;
    --border: #e9ecef;
    --footer-bg: #ffffff;
    --footer-border: #e9ecef;
    --footer-text: #121212;
    --footer-muted: #6c757d;
    --footer-link: #6c757d;
    --footer-link-hover: #121212;

    /* Spacing */
    --container-width: 1440px;
    --header-height: 80px;

    /* Typography */
    --font-main: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-display: 'Outfit', sans-serif;
}

[data-theme="dark"] {
    --bg-primary: #121212;
    --bg-secondary: #1e1e1e;
    --text-primary: #ffffff;
    --text-secondary: #a0a0a0;
    --accent: #e0e0e0;
    --border: #333333;
    --footer-bg: #121212;
    --footer-border: rgba(255, 255, 255, 0.08);
    --footer-text: #f5f7fb;
    --footer-muted: rgba(245, 247, 251, 0.72);
    --footer-link: rgba(245, 247, 251, 0.72);
    --footer-link-hover: #ffffff;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font-main);
    background-color: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    transition: background-color 0.3s ease, color 0.3s ease;
    overflow-x: hidden;
}

/* Typography Utilities */
h1,
h2,
h3,
h4,
h5,
h6 {
    font-family: var(--font-display);
    font-weight: 600;
    line-height: 1.2;
}

a {
    text-decoration: none;
    color: inherit;
    transition: color 0.2s ease;
}

/* Header - Enhanced Transparency with Navigation */
.main-header {
    height: var(--header-height);
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    z-index: 1000;
    border-bottom: 1px solid transparent;
    transition: all 0.3s ease;
}

[data-theme="dark"] .main-header {
    background: rgba(18, 18, 18, 0.7);
}

.main-header.scrolled {
    border-color: var(--border);
    background: rgba(255, 255, 255, 0.9);
}

[data-theme="dark"] .main-header.scrolled {
    background: rgba(18, 18, 18, 0.9);
}

.header-inner {
    max-width: var(--container-width);
    margin: 0 auto;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 2rem;
}

.logo {
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: -0.03em;
}

.brand-wrapper {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.main-nav {
    display: flex;
    align-items: center;
    gap: 2rem;
    margin-left: 3rem;
}

.nav-link {
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--text-primary);
    transition: color 0.2s ease;
    position: relative;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    width: 0;
    height: 2px;
    background-color: var(--text-primary);
    transition: width 0.3s ease;
}

.nav-link:hover {
    color: var(--text-secondary);
}

.nav-link:hover::after {
    width: 100%;
}

.search-container {
    flex: 1;
    max-width: 400px;
    margin: 0 2rem;
    position: relative;
    display: flex;
    align-items: center;
    border: 1px solid var(--border);
    border-radius: 100px;
    background-color: var(--bg-secondary);
    padding: 0.25rem 0.5rem;
    transition: all 0.2s ease;
}

.search-container:focus-within {
    border-color: var(--text-primary);
    background-color: var(--bg-primary);
    box-shadow: 0 0 0 4px rgba(0, 0, 0, 0.05);
}

[data-theme="dark"] .search-container:focus-within {
    box-shadow: 0 0 0 4px rgba(255, 255, 255, 0.05);
}

.search-input {
    flex: 1;
    width: 100%;
    padding: 0.5rem 1rem;
    border: none;
    background: transparent;
    color: var(--text-primary);
    font-family: var(--font-main);
    font-size: 0.95rem;
}

.search-input:focus {
    outline: none;
    box-shadow: none;
}

.search-submit-btn {
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.2s;
}

.search-submit-btn:hover {
    color: var(--text-primary);
}

/* ========================================
   Global Avatar System (Generative Design)
   ======================================== */
.avatar {
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    /* Always Circular */
    color: white;
    font-weight: 700;
    font-family: var(--font-display);
    overflow: hidden;
    object-fit: cover;
    flex-shrink: 0;
    /* Default Size (MD) */
    width: 40px;
    height: 40px;
    font-size: 1rem;
}

/* Avatar Sizes */
.avatar-sm {
    width: 32px;
    height: 32px;
    font-size: 0.8rem;
}

.avatar-md {
    width: 40px;
    height: 40px;
    font-size: 1rem;
}

.avatar-lg {
    width: 64px;
    height: 64px;
    font-size: 1.5rem;
}

.avatar-xl {
    width: 100px;
    height: 100px;
    font-size: 2.5rem;
    border-radius: 20px;
    /* XL might use rounded rect in some designs, but stick to circle if needed. Logic suggests 'profile-avatar-large' was rect. Let's keep consistency or follow Admin design. Admin uses rounded-rect for large. Let's make it consistent: Circle for all avatars? Plan said Circular. But Admin Detail used Rounded Rect. Let's stick to circle for unified 'avatar' class, but override for verified large if needed. Actually plan said "Artists and Admin pages ... use Name Initial". Let's use Circle for all standard Avatars. */
    border-radius: 50%;
}

/* Admin Detail page uses Rect for Large. Let's add a variant if needed, or just standard circle.
   For now, sticking to standard circle for .avatar class */

/* Avatar Gradients - Consistent with Client Side */
.bg-gradient-0 {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.bg-gradient-1 {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
}

.bg-gradient-2 {
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
}

.bg-gradient-3 {
    background: linear-gradient(135deg, #43e97b 0%, #38f9d7 100%);
}

.bg-gradient-4 {
    background: linear-gradient(135deg, #fa709a 0%, #fee140 100%);
}

.bg-gradient-5 {
    background: linear-gradient(135deg, #30cfd0 0%, #330867 100%);
}

.bg-gradient-6 {
    background: linear-gradient(135deg, #a8edea 0%, #fed6e3 100%);
}

.bg-gradient-7 {
    background: linear-gradient(135deg, #ff9a9e 0%, #fecfef 100%);
}

.nav-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.login-btn {
    padding: 0.5rem 1.25rem;
    border: 1.5px solid var(--border);
    border-radius: 100px;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.2s ease;
    background: transparent;
}

.login-btn:hover {
    background: var(--text-primary);
    color: var(--bg-primary);
    border-color: var(--text-primary);
}

.theme-btn {
    background: none;
    border: none;
    color: var(--text-primary);
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.2s;
}

.theme-btn:hover {
    background-color: var(--bg-secondary);
}

/* Hero Section */
.hero-section {
    padding-top: 100px;
    /* 상단 여백 (헤더 80px + 추가 40px) */
    padding-bottom: 10px;
    /* 하단 여백 */
    padding-left: 2rem;
    padding-right: 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    text-align: center;
}

.hero-content {
    max-width: 800px;
    margin: 0 auto;
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2rem;
}

.hero-logo {
    color: var(--text-primary);
    animation: float 6s ease-in-out infinite;
}

.main-home .hero-logo-text {
    font-family: var(--font-display, 'Outfit', sans-serif);
    font-size: clamp(2.5rem, 4vw, 4.5rem);
    font-weight: 700;
    letter-spacing: -0.03em;
    display: block;
}

@keyframes float {
    0% {
        transform: translateY(0px);
    }

    50% {
        transform: translateY(-10px);
    }

    100% {
        transform: translateY(0px);
    }
}

.hero-text h1 {
    font-size: 3.5rem;
    margin-bottom: 0.5rem;
    letter-spacing: -0.02em;
    line-height: 1.1;
}

.hero-text p {
    font-size: 1.25rem;
    color: var(--text-secondary);
    max-width: 600px;
    margin: 0 auto;
}

/* Gallery Section */
.gallery-section {
    padding: 8rem 5rem 2rem;
    max-width: var(--container-width);
    margin: 0 auto;
}

.section-divider {
    border: 0;
    border-top: 1px solid var(--border);
    margin: 0.5rem auto;
    max-width: var(--container-width);
}

.category-filters {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 3rem;
    flex-wrap: wrap;
}

/* [NEW] For mainHome scrollable filter - single line layout */
.filter-controls {
    display: flex !important;
    flex-wrap: nowrap !important;
    gap: 0.5rem;
    width: max-content;
    margin: 0 auto;
}

.filter-btn {
    background: none;
    border: 1px solid var(--border);
    padding: 0.5rem 1.5rem;
    border-radius: 100px;
    cursor: pointer;
    font-family: var(--font-main);
    font-size: 0.95rem;
    color: var(--text-secondary);
    transition: all 0.2s ease;
}

.filter-btn:hover,
.filter-btn.active {
    background-color: var(--text-primary);
    color: var(--bg-primary);
    border-color: var(--text-primary);
}

.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 2rem;
}

.gallery-item {
    position: relative;
    border-radius: 12px;
    overflow: hidden;
    cursor: pointer;
    aspect-ratio: 1/1;
}

.gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.5s ease;
}

.item-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 2rem;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.9), rgba(0, 0, 0, 0.6) 70%, transparent);
    color: white;
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.3s ease;
}

.gallery-item:hover img {
    transform: scale(1.05);
}

.gallery-item:hover .item-overlay {
    opacity: 1;
    transform: translateY(0);
}

.item-overlay h3 {
    font-size: 1.25rem;
    margin-bottom: 0.5rem;
    font-weight: 600;
}

.item-overlay .artist-name {
    font-size: 0.95rem;
    opacity: 0.9;
    font-weight: 400;
    font-style: italic;
}

/* Artists Section - Carousel */
.artists-section {
    padding: 1.5rem 2rem;
    max-width: var(--container-width);
    margin: 0 auto;
}

.artists-section .section-title {
    font-size: 1.75rem;
    margin-bottom: 3rem;
    text-align: center;
}

.artist-carousel-container {
    position: relative;
    max-width: 1000px;
    margin: 0 auto;
}

.artist-carousel {
    display: flex;
    gap: 2rem;
    overflow-x: auto;
    overflow-y: hidden;
    position: relative;
    scroll-snap-type: x mandatory;
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    -ms-overflow-style: none;
    padding: 0 6%;
}

.artist-carousel::-webkit-scrollbar {
    display: none;
}

.artist-carousel.count-1,
.artist-carousel.count-2 {
    justify-content: center;
}

.artist-card {
    flex: 0 0 260px;
    max-width: 260px;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    scroll-snap-align: center;
}

.artist-card.active {
    display: flex;
}

.artist-image {
    width: 180px;
    height: 180px;
    border-radius: 50%;
    overflow: hidden;
    margin-bottom: 2rem;
    border: 4px solid var(--border);
}

.artist-image-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    font-weight: 700;
    font-family: var(--font-display);
    font-size: 4rem;
    border-radius: 50%;
}

.artist-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.artist-info h3 {
    font-size: 1.75rem;
    margin-bottom: 0.5rem;
}

.artist-category {
    color: var(--text-secondary);
    font-size: 1rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 1rem;
}

.artist-bio {
    max-width: 600px;
    font-size: 1.1rem;
    line-height: 1.8;
    color: var(--text-secondary);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

@media (max-width: 1199px) {
    .artist-image {
        width: 170px;
        height: 170px;
    }
}

@media (max-width: 900px) {
    .artist-card {
        flex: 0 0 100%;
        max-width: 100%;
    }

    .artist-carousel.count-1 .artist-card,
    .artist-carousel.count-2 .artist-card {
        flex: 0 0 100%;
        max-width: 100%;
    }

    .artist-image {
        width: 160px;
        height: 160px;
    }
}

.carousel-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: var(--bg-primary);
    border: 2px solid var(--border);
    border-radius: 50%;
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    color: var(--text-primary);
    z-index: 10;
}

/* Global Section Title */
.section-title {
    font-size: 1.75rem;
    font-weight: 800;
    margin-bottom: 3rem;
    position: relative;
    color: var(--text-primary, #121212);
    letter-spacing: -0.02em;
    line-height: 1.2;
    display: flex;
    align-items: center;
    gap: 0.6rem;
}

/* Featured Artists 중앙 정렬 보정 (Flex + Margin Auto) */
.artists-section .section-title {
    margin: 0 auto 3rem auto;
    width: fit-content;
    /* 내용물 크기만큼만 차지 */
}

/* MainHome Section Title - Underline Accent */
.main-home .section-title {
    display: inline-block;
    position: relative;
    padding-bottom: 0.35rem;
}

.main-home .section-title::after {
    content: '';
    position: absolute;
    left: 0;
    bottom: 0;
    width: 100%;
    height: 3px;
    background-color: var(--section-accent, currentColor);
    border-radius: 999px;
}

.main-home .artists-section .section-title {
    --section-accent: #9C27B0;
    display: block;
    width: fit-content;
    margin: 0 auto 3rem auto;
}

.main-home .gallery-section .section-title {
    --section-accent: #dc2626;
    display: block;
    width: fit-content;
    margin: 0 auto 3rem auto;
    text-align: center;
}

.main-home .exhibition-section .section-title {
    --section-accent: #1976D2;
    display: block;
    width: fit-content;
    margin: 0 auto 3rem auto;
    text-align: center;
}

.main-home .community-col:first-child .section-title {
    --section-accent: #00796B;
}

.main-home .community-col:last-child .section-title {
    --section-accent: #E65100;
}

.carousel-nav:hover {
    background: var(--text-primary);
    border-color: var(--text-primary);
    color: var(--bg-primary);
    transform: translateY(-50%) scale(1.1);
}

.carousel-nav.prev {
    left: -25px;
}

.carousel-nav.next {
    right: -25px;
}

/* Community Section */
.community-section {
    padding: 4rem 2rem;
    max-width: var(--container-width);
    margin: 0 auto;
    border-top: 1px solid var(--border);
}

.community-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
}

.community-col .section-title {
    font-size: 1.75rem;
    margin-bottom: 2rem;
}

.community-list {
    list-style: none;
}

.community-item {
    padding: 1.5rem 0;
    border-bottom: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.community-item:first-child {
    padding-top: 0;
}

.community-item a {
    font-size: 1.1rem;
    font-weight: 500;
}

.community-item a:hover {
    color: var(--text-secondary);
}

.community-item .meta {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.tag {
    display: inline-block;
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    margin-bottom: 0.25rem;
    width: fit-content;
}

.tag.new {
    background-color: rgba(46, 204, 113, 0.1);
    color: #2ecc71;
}

.tag.hot {
    background-color: rgba(231, 76, 60, 0.1);
    color: #e74c3c;
}

/* Exhibition Section */
.exhibition-section {
    padding: 1.5rem 2rem;
    max-width: var(--container-width);
    margin: 0 auto;
}

.exhibition-section .section-title {
    font-size: 1.75rem;
    /* Latest Talks와 동일한 크기 */
    margin-bottom: 3rem;
}

.exhibition-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 180px));
    gap: 1.25rem;
    justify-content: center;
}

.exhibition-empty {
    display: flex;
    justify-content: center;
}

.exhibition-empty-text {
    font-weight: 400;
    color: #9ca3af;
    text-align: center;
}

.exhibition-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    width: 100%;
    cursor: pointer;
}

.exhibition-image {
    width: 100%;
    aspect-ratio: 3/4;
    border-radius: 12px;
    overflow: hidden;
    margin-bottom: 0.75rem;
    background-color: var(--bg-secondary);
}

.exhibition-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.exhibition-card:hover .exhibition-image img {
    transform: scale(1.05);
}

.exhibition-info h3 {
    font-size: 0.95rem;
    margin-bottom: 0.35rem;
}

.exhibition-info .date {
    color: var(--text-secondary);
    font-size: 0.8rem;
    margin-bottom: 0.2rem;
}

.exhibition-info .location {
    font-weight: 400;
    font-size: 0.85rem;
}


/* Footer */
.main-footer {
    background-color: var(--footer-bg);
    border-top: 1px solid var(--footer-border);
    color: var(--footer-text);
    padding: 4rem 2rem;
    margin-top: 0;
}

/* Dashboard 페이지에서 footer가 sidebar 영역을 침범하지 않도록 */
.page-dashboard .main-footer {
    margin-left: 280px;
}

@media (max-width: 1024px) {
    .page-dashboard .main-footer {
        margin-left: 0;
    }
}

.footer-content {
    max-width: var(--container-width);
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.footer-links {
    display: flex;
    gap: 2rem;
}

.footer-links a {
    color: var(--footer-link);
}

.footer-links a:hover {
    color: var(--footer-link-hover);
}

.footer-brand p {
    color: var(--footer-muted);
}

/* Responsive */
@media (max-width: 1024px) {
    .hero-content {
        padding-top: calc(var(--header-height) + 2rem);
    }

    .main-nav {
        display: none;
    }

    .search-container {
        max-width: 300px;
        margin: 0 1rem;
    }

    .gallery-grid {
        grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    }
}

/* Mobile: Fixed 2 columns for gallery */
@media (max-width: 768px) {
    .gallery-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1rem;
    }
}

.carousel-nav.prev {
    left: -10px;
}

.carousel-nav.next {
    right: -10px;
}

.community-grid {
    grid-template-columns: 1fr;
    gap: 3rem;
}

@media (max-width: 768px) {
    .hero-text h1 {
        font-size: 2.5rem;
    }

    .search-container {
        max-width: 200px;
    }

    .login-btn {
        display: none;
    }

    .artist-carousel-container {
        padding: 0 50px;
    }

    .carousel-nav {
        width: 40px;
        height: 40px;
    }

    .artist-image {
        width: 150px;
        height: 150px;
    }

    .exhibition-grid {
        grid-template-columns: 1fr;
    }

    .footer-content {
        flex-direction: column;
        gap: 2rem;
    }
}

/*===============================================================*/

/* Auth Pages (Signup/Login) */
.auth-section {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--header-height) 2rem 4rem;
    background-color: var(--bg-primary);
}

.auth-container {
    width: 100%;
    max-width: 480px;
    margin: 0 auto;
    padding: 3rem;
    background-color: var(--bg-primary);
    border: 1px solid var(--border);
    border-radius: 24px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.05);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

[data-theme="dark"] .auth-container {
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);
}

.auth-container:hover {
    transform: translateY(-5px);
    box-shadow: 0 30px 60px rgba(0, 0, 0, 0.08);
}

[data-theme="dark"] .auth-container:hover {
    box-shadow: 0 30px 60px rgba(0, 0, 0, 0.3);
}

.auth-header {
    text-align: center;
    margin-bottom: 2.5rem;
}

.auth-header h1 {
    font-size: 2rem;
    margin-bottom: 0.75rem;
    color: var(--text-primary);
}

.auth-header p {
    color: var(--text-secondary);
    font-size: 1rem;
}

.auth-form {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.form-label {
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-primary);
    margin-left: 0.25rem;
}

.form-input {
    padding: 0.875rem 1rem;
    border: 1.5px solid var(--border);
    border-radius: 12px;
    background-color: var(--bg-secondary);
    color: var(--text-primary);
    font-family: var(--font-main);
    font-size: 1rem;
    transition: all 0.2s ease;
}

/* select 태그인 경우에만 적용되는 스타일 */
select.form-input {
    /* 1. 브라우저 기본 화살표 제거 */
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;

    /* 2. 커스텀 화살표 아이콘 추가 (SVG) */
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%236b7280'%3e%3cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M19 9l-7 7-7-7'%3e%3c/path%3e%3c/svg%3e");

    /* 3. 아이콘 반복 방지 및 크기 설정 */
    background-repeat: no-repeat;
    background-size: 1.25rem;
    /* 아이콘 크기 */

    /* 4. [핵심] 화살표 위치 조정 (오른쪽에서 1rem 만큼 띄움) */
    background-position: right 1rem center;

    /* 5. 글자가 화살표에 겹치지 않도록 오른쪽 여백 확보 */
    padding-right: 2.5rem;
}

.form-input:focus {
    outline: none;
    border-color: var(--text-primary);
    background-color: var(--bg-primary);
    box-shadow: 0 0 0 4px rgba(0, 0, 0, 0.05);
}

[data-theme="dark"] .form-input:focus {
    box-shadow: 0 0 0 4px rgba(255, 255, 255, 0.05);
}

.form-input::placeholder {
    color: var(--text-secondary);
    opacity: 0.7;
}

.auth-btn {
    margin-top: 1rem;
    padding: 1rem;
    background-color: var(--text-primary);
    color: var(--bg-primary);
    border: none;
    border-radius: 12px;
    font-family: var(--font-main);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.auth-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
}

[data-theme="dark"] .auth-btn:hover {
    box-shadow: 0 10px 20px rgba(255, 255, 255, 0.1);
}

.auth-btn:active {
    transform: translateY(0);
}

.auth-links {
    text-align: center;
    margin-top: 1.5rem;
    font-size: 1.2rem;
    color: var(--text-secondary);
}

.auth-links a {
    color: var(--text-primary);
    font-weight: 600;
    margin-left: 0.25rem;
}

.auth-links a:hover {
    text-decoration: underline;
}

@media (max-width: 480px) {
    .auth-container {
        padding: 2rem 1.5rem;
        border: none;
        box-shadow: none;
        background: transparent;
    }

    .auth-container:hover {
        transform: none;
        box-shadow: none;
    }
}

/* ========================================
   PROFILE EDIT PAGE
   ======================================== */
.profile-edit-container {
    width: 100%;
    max-width: 600px;
    margin: 0 auto;
    padding: 3rem;
    background-color: var(--bg-primary);
    border: 1px solid var(--border);
    border-radius: 24px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.05);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

[data-theme="dark"] .profile-edit-container {
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);
}

.profile-edit-container:hover {
    transform: translateY(-5px);
    box-shadow: 0 30px 60px rgba(0, 0, 0, 0.08);
}

[data-theme="dark"] .profile-edit-container:hover {
    box-shadow: 0 30px 60px rgba(0, 0, 0, 0.3);
}

.profile-image-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: 2rem;
}

.profile-image-preview {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    overflow: hidden;
    margin-bottom: 1rem;
    border: 3px solid var(--border);
    position: relative;
    /* 오버레이 위치 기준점 */
}

/* 이미지 오버레이 스타일 추가 */
.image-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    transition: opacity 0.3s ease;
    color: white;
    cursor: pointer;
}

.profile-image-preview:hover .image-overlay {
    opacity: 1;
}

.profile-image-preview img,
.profile-image-preview .avatar {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.upload-btn {
    padding: 0.6rem 1.5rem;
    background-color: var(--bg-secondary);
    color: var(--text-primary);
    border: 1px solid var(--border);
    border-radius: 12px;
    font-family: var(--font-main);
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.upload-btn:hover {
    background-color: var(--text-primary);
    color: var(--bg-primary);
    border-color: var(--text-primary);
}

.form-hint {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-top: 0.25rem;
}

.secondary-btn {
    padding: 0.875rem 1rem;
    background-color: var(--bg-secondary);
    color: var(--text-primary);
    border: 1.5px solid var(--border);
    border-radius: 12px;
    font-family: var(--font-main);
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.secondary-btn:hover {
    background-color: var(--text-primary);
    color: var(--bg-primary);
    border-color: var(--text-primary);
}

.profile-form {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

/* ========================================
   MODAL STYLES
   ======================================== */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 2000;
    align-items: center;
    justify-content: center;
}

.modal-content {
    background-color: var(--bg-primary);
    border-radius: 20px;
    width: 90%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.2);
    animation: modalSlideIn 0.3s ease;
}

[data-theme="dark"] .modal-content {
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.5);
}

@keyframes modalSlideIn {
    from {
        transform: translateY(-50px);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.modal-header {
    padding: 2rem 2rem 1rem;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h2 {
    font-size: 1.5rem;
    color: var(--text-primary);
}

.modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 0.5rem;
    line-height: 1;
    transition: color 0.2s ease;
}

.modal-close:hover {
    color: var(--text-primary);
}

.modal-body {
    padding: 2rem;
}

.modal-description {
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
    font-size: 0.95rem;
}

.modal-actions {
    display: flex;
    gap: 1rem;
    margin-top: 2rem;
}

.modal-actions button {
    flex: 1;
    margin-top: 0 !important;
    padding: 0.875rem 1rem !important;
}

.form-options {
    display: flex;
    justify-content: space-between;
    /* 좌우 끝으로 정렬 */
    align-items: center;
    /* 수직 중앙 정렬 */
    width: 100%;
    /* 가로 폭 꽉 채우기 */
}

/* ========================================
   Dashboard 전용 스타일 코드
   ======================================== */

/* Dashboard Layout */
.dashboard-layout {
    display: flex;
    min-height: 100vh;
    padding-top: var(--header-height);
}

/* Sidebar Navigation */
.dashboard-sidebar {
    width: 280px;
    background-color: var(--bg-secondary);
    border-right: 1px solid var(--border);
    padding: 2rem 0;
    position: fixed;
    left: 0;
    /* top을 header height만큼 띄우되, 모바일에서는 전체를 덮는 게 자연스러울 수 있음 */
    top: var(--header-height);
    bottom: 0;
    overflow-y: auto;
    transition: transform 0.3s ease;

    /* [핵심] 기본적으로 화면 밖으로 숨김 */
    transform: translateX(-100%);
    z-index: 1001;
    /* 오버레이(998)보다 높아야 함 */
}

/* [추가] 모바일 활성화 클래스 */
.dashboard-sidebar.active {
    transform: translateX(0);
}

/* [추가] PC 화면(1024px 이상)에서 Global Sidebar는 무조건 숨김 */
@media (min-width: 1025px) {
    /* #globalSidebar {
        display: none !important;
    }*/

    /* 대시보드 사이드바는 PC에서 보여야 하므로 복구 */
    #dashboardSidebar {
        transform: translateX(0);
        z-index: 1;
        /* 헤더보다 아래로 */
    }
}

.sidebar-menu {
    list-style: none;
    padding: 0 1rem;
}

.sidebar-menu li {
    margin-bottom: 0.5rem;
}

.sidebar-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.875rem 1rem;
    border-radius: 12px;
    color: var(--text-secondary);
    font-weight: 500;
    transition: all 0.2s ease;
}

.sidebar-link:hover {
    background-color: var(--bg-primary);
    color: var(--text-primary);
}

.sidebar-link.active {
    background-color: var(--text-primary);
    color: var(--bg-primary);
}

.sidebar-icon {
    width: 20px;
    height: 20px;
}

/* Main Dashboard Content */
.dashboard-main {
    flex: 1;
    margin-left: 280px;
    padding: 2rem;
    background-color: var(--bg-primary);
}

.dashboard-header {
    margin-bottom: 2rem;
}

.dashboard-title {
    font-size: 2rem;
    margin-bottom: 0.5rem;
}

.dashboard-subtitle {
    color: var(--text-secondary);
    font-size: 1rem;
}

/* Dashboard Breadcrumb */
.dashboard-breadcrumb {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1rem;
    font-size: 0.875rem;
}

.breadcrumb-link {
    color: var(--text-secondary);
    text-decoration: none;
    transition: color 0.2s;
}

.breadcrumb-link:hover {
    color: var(--primary);
}

.breadcrumb-separator {
    color: var(--text-secondary);
    opacity: 0.5;
}

.breadcrumb-current {
    color: var(--text-primary);
    font-weight: 500;
}

/* Dashboard Cards Grid */
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

/* Dashboard Card Component */
.dashboard-card {
    background-color: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 1.75rem;
    transition: all 0.3s ease;
}

.dashboard-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.1);
}

[data-theme="dark"] .dashboard-card:hover {
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.3);
}

.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.5rem;
}

.card-title {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.card-icon {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    background-color: var(--bg-primary);
}

.card-value {
    font-size: 2.25rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
}

.card-label {
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.card-trend {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    font-size: 0.85rem;
    font-weight: 600;
    margin-top: 0.5rem;
}

.card-trend.positive {
    color: #2ecc71;
}

.card-trend.negative {
    color: #e74c3c;
}

/* Activity Section */
.activity-section {
    background-color: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 2rem;
    margin-bottom: 2rem;
}

.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.5rem;
}

.activity-section .section-title {
    font-size: 1.25rem;
    font-weight: 600;
}

.view-all-link {
    font-size: 0.9rem;
    color: var(--text-secondary);
    font-weight: 500;
    transition: color 0.2s ease;
}

.view-all-link:hover {
    color: var(--text-primary);
}

.activity-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.activity-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    background-color: var(--bg-primary);
    border-radius: 12px;
    transition: background-color 0.2s ease;
}

.activity-item:hover {
    background-color: var(--border);
}

.activity-icon {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background-color: var(--bg-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.activity-content {
    flex: 1;
}

.activity-title {
    font-size: 0.95rem;
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.activity-description {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.activity-time {
    font-size: 0.8rem;
    color: var(--text-secondary);
    white-space: nowrap;
}

/* Quick Actions Section */
.quick-actions-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
}

.quick-action-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    padding: 1.25rem;
    background-color: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 12px;
    font-family: var(--font-main);
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-primary);
    cursor: pointer;
    transition: all 0.2s ease;
}

.quick-action-btn:hover {
    background-color: var(--text-primary);
    color: var(--bg-primary);
    border-color: var(--text-primary);
    transform: translateY(-2px);
}

/* Profile Section in Sidebar */
.sidebar-profile {
    padding: 0 1rem 2rem;
    border-bottom: 1px solid var(--border);
    margin-bottom: 1.5rem;
}

.profile-avatar {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background-color: var(--bg-primary);
    border: 2px solid var(--border);
    margin-bottom: 1rem;
    overflow: hidden;
}

/* Layout global sidebar should cover header */
body:not(.has-platform-header) #globalSidebar {
    top: 0;
    height: 100vh;
    z-index: 1003;
}

.global-sidebar .profile-avatar {
    margin-left: auto;
    margin-right: auto;
}

.profile-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.profile-name {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.profile-email {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

/* Mobile Responsive */
@media (max-width: 1024px) {
    .dashboard-sidebar {
        transform: translateX(-100%);
        z-index: 999;
    }

    .dashboard-sidebar.active {
        transform: translateX(0);
    }

    .dashboard-main {
        margin-left: 0;
    }

    .dashboard-grid {
        grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    }
}

@media (max-width: 768px) {
    .dashboard-main {
        padding: 1.5rem 1rem;
    }

    .dashboard-title {
        font-size: 1.5rem;
    }

    .dashboard-grid {
        grid-template-columns: 1fr;
    }

    .quick-actions-grid {
        grid-template-columns: 1fr;
    }

    .card-value {
        font-size: 1.75rem;
    }

    .activity-section,
    .dashboard-card {
        padding: 1.25rem;
    }
}

/* Mobile Menu Toggle Button */
.mobile-menu-btn {
    display: flex;
    background: none;
    border: none;
    color: var(--text-primary);
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 8px;
    transition: background-color 0.2s;
}

.mobile-menu-btn:hover {
    background-color: var(--bg-secondary);
}

@media (max-width: 1024px) {
    .mobile-menu-btn {
        display: block;
    }
}

/* Overlay for Mobile Sidebar */
.sidebar-overlay {
    display: none;
    position: fixed;
    top: var(--header-height);
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 998;
}

body:not(.has-platform-header) #sidebarOverlay {
    top: 0;
    z-index: 1002;
}

.sidebar-overlay.active {
    display: block;
}

/* --- Preview Area (The Magic Part) --- */
.preview-area {
    background: var(--bg-primary);
    border-radius: 16px;
    border: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    height: 100%;
}

.preview-header {
    padding: 1rem 1.5rem;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--bg-secondary);
}

.preview-badge {
    background: #2ecc71;
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 700;
}

/* Preview Scroll Wrapper */
.preview-scroll-wrapper {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    background: #f0f2f5;
    /* Neutral background behind the site preview */
    padding: 2rem;
    display: flex;
    justify-content: center;
}

[data-theme="dark"] .preview-scroll-wrapper {
    background: #121212;
}

/* ========================================= */
/* [SYSTEM] Main Layout Container            */
/* ========================================= */

/* 1. 기본 상태 (실제 사이트: member-home-new.html) */
/* 화면 전체를 꽉 채우도록 설정 */
.preview-wrapper {
    width: 100%;
    min-height: 100vh;
    /* 전체 높이 */
    display: flex;
    flex-direction: column;
    /* 기본: 상단 메뉴 */
    position: relative;
    background-color: var(--bg-color, #ffffff);

    /* 🚨 [핵심 수정] 아래 속성들을 여기서 제거하거나 초기화해야 합니다. */
    max-width: none;
    box-shadow: none;
    border-radius: 0;
    margin: 0;
}

/* 2. 빌더 모드 (커스터마이징 페이지: form.html) */
/* .preview-scroll-wrapper 안에 있을 때만 '카드 형태'로 축소 */
.preview-scroll-wrapper .preview-wrapper {
    max-width: 1200px;
    /* 너비 제한 */
    min-height: 800px;
    /* 최소 높이 고정 */
    margin: 0 auto;
    /* 중앙 정렬 */
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    /* 그림자 효과 */
    border-radius: 8px;
    /* 둥근 모서리 */
    /*overflow: hidden;       !* 내부 넘침 방지 *!*/
}

/* ========================================= */
/* [SYSTEM] Layout Variants (Menu Position)  */
/* ========================================= */

/* PC 화면 (1025px 이상) */
@media (min-width: 1025px) {
    .preview-wrapper.menu-left {
        flex-direction: row;
        /* 좌측 메뉴 */
    }

    .preview-wrapper.menu-right {
        flex-direction: row-reverse;
        /* 우측 메뉴 */
    }
}

/* 사이드 메뉴일 때 네비게이션바 크기 설정 */
@media (min-width: 1025px) {

    .menu-left .preview-nav,
    .menu-right .preview-nav {
        width: 280px;
        /* 사이드바 고정 너비 */
        flex-shrink: 0;
        /* 줄어들지 않음 */
        flex-direction: column;
        height: auto;
        min-height: 100vh;
        /* 전체 높이 */
        padding-top: 4rem;
        border-bottom: none;
    }

    .menu-left .preview-nav {
        border-right: 1px solid rgba(0, 0, 0, 0.05);
    }

    .menu-right .preview-nav {
        border-left: 1px solid rgba(0, 0, 0, 0.05);
    }

    /* 빌더 모드에서는 높이 조정 */
    .preview-scroll-wrapper .menu-left .preview-nav,
    .preview-scroll-wrapper .menu-right .preview-nav {
        min-height: 100%;
        /* 빌더 안에서는 부모 높이에 맞춤 */
    }
}

/* 모바일/태블릿 (1024px 이하) - 강제 상단 메뉴 */
@media (max-width: 1024px) {

    .preview-wrapper.menu-left,
    .preview-wrapper.menu-right {
        flex-direction: column !important;
    }

    .menu-left .preview-nav,
    .menu-right .preview-nav {
        width: 100% !important;
        height: auto !important;
        min-height: auto !important;
        flex-direction: row !important;
        padding: 1.5rem 2rem !important;
        border-right: none !important;
        border-left: none !important;
        border-bottom: 1px solid rgba(0, 0, 0, 0.05) !important;
    }
}

/* Layout Variants for Menu Position */
.preview-wrapper.menu-left {
    flex-direction: row;
}

.preview-wrapper.menu-right {
    flex-direction: row-reverse;
}

/* Sidebar Nav in Preview */
.preview-wrapper.menu-left .preview-nav,
.preview-wrapper.menu-right .preview-nav {
    width: 250px;
    flex-shrink: 0;
    flex-direction: column;
    height: auto;
    min-height: 100%;
    border-bottom: none;
    padding-top: 3rem;
}

.preview-wrapper.menu-left .preview-nav {
    border-right: 1px solid rgba(0, 0, 0, 0.05);
}

.preview-wrapper.menu-right .preview-nav {
    border-left: 1px solid rgba(0, 0, 0, 0.05);
}

/* Top Nav in Preview */
.preview-nav {
    padding: 1.5rem 2rem;
    display: flex;
    gap: 2rem;
    align-items: center;
    transition: all 0.3s ease;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

.preview-nav-link {
    text-decoration: none;
    color: inherit;
    font-weight: 500;
    transition: all 0.2s;
}

/* Preview Content Body */
.preview-content {
    flex: 1;
    padding: 3rem;
    transition: background-color 0.3s;
}

.preview-title {
    margin-bottom: 2rem;
    line-height: 1.2;
    transition: all 0.3s;
}

.preview-description {
    max-width: 600px;
    margin-bottom: 3rem;
    opacity: 0.8;
}

/* ========================================= */
/* [CORE] Gallery Layout System              */
/* ========================================= */

:root {
    /* 기본 카드 사이즈 (JS가 로드되기 전 초기값) */
    --card-size: 280px;
    --gap-size: 2rem;
    --border-radius: 12px;
}

.preview-gallery {
    width: 100%;
    margin: 0 auto;
    box-sizing: border-box;
}

/* 1. Grid Layout (정사각형 타일) */
.preview-gallery.layout-grid {
    display: grid;
    /* 핵심: 변수로 최소 너비를 제어 */
    grid-template-columns: repeat(auto-fill, minmax(var(--card-size), 1fr));
    gap: var(--gap-size);
}

.preview-gallery.layout-grid .preview-item {
    aspect-ratio: 1 / 1;
    /* 정사각형 강제 */
    overflow: hidden;
    border-radius: var(--border-radius);
    position: relative;
}

.preview-gallery.layout-grid .item-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    /* 꽉 채우기 */
    transition: transform 0.3s ease;
}

/* 2. Masonry Layout (벽돌 쌓기 - CSS 전용, JS 불필요) */
.preview-gallery.layout-masonry {
    display: block;
    column-width: var(--card-size);
    /* 컬럼 너비로 자동 단 수 조절 */
    column-gap: var(--gap-size);
}

.preview-gallery.layout-masonry .preview-item {
    break-inside: avoid;
    /* 잘림 방지 */
    margin-bottom: var(--gap-size);
    border-radius: var(--border-radius);
    overflow: hidden;
}

.preview-gallery.layout-masonry .item-image {
    width: 100%;
    height: auto;
    /* 비율 유지 */
    display: block;
    object-fit: cover;
}

/* 3. List Layout (한 줄 리스트) */
.preview-gallery.layout-list {
    display: flex;
    flex-direction: column;
    gap: 3rem;
    max-width: 900px;
    /* 리스트형은 너무 넓으면 안 예쁨 */
    margin: 0 auto;
}

.preview-gallery.layout-list .preview-item {
    width: 100%;
}

.preview-gallery.layout-list .item-image {
    width: 100%;
    max-height: 700px;
    /* 너무 길어짐 방지 */
    object-fit: cover;
    border-radius: var(--border-radius);
}

/* 공통 텍스트 스타일 */
.item-title {
    margin-top: 1rem;
    font-weight: 600;
    width: 100%;
    word-break: break-all;
    text-align: center;
    /* 기본 중앙 */
}

.preview-gallery.layout-list .item-title {
    text-align: left;
    /* 리스트만 왼쪽 정렬 */
    font-size: 1.5rem;
}


/* Modal */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 2000;
    justify-content: center;
    align-items: center;
    backdrop-filter: blur(5px);
}

.modal-content {
    background: var(--bg-primary);
    padding: 2rem;
    border-radius: 12px;
    width: 90%;
    max-width: 500px;
}

.modal-actions {
    display: flex;
    gap: 1rem;
    margin-top: 1.5rem;
}

.modal-actions button {
    flex: 1;
}

/* Responsive */
@media (max-width: 1024px) {
    .customize-container {
        grid-template-columns: 1fr;
        height: auto;
    }

    .control-panel {
        height: auto;
        margin-bottom: 2rem;
    }

    .preview-scroll-wrapper {
        height: 600px;
    }
}


/* ========================================= */
/* [FIX] Title Alignment & Size Utilities    */
/* ========================================= */

/* 정렬 클래스 (HTML의 align-center 등과 매칭) */
.preview-title.align-center {
    text-align: center;
}

.preview-title.align-left {
    text-align: left;
}

.preview-title.align-right {
    text-align: right;
}

/* 폰트 크기 클래스 (HTML의 size-large 등과 매칭) */
.preview-title.size-medium {
    font-size: 2rem;
}

.preview-title.size-large {
    font-size: 3rem;
}

.preview-title.size-xl {
    font-size: 4.5rem;
}

/* ========================================= */
/* [FIX] Sticky (고정) 기능 활성화           */
/* ========================================= */

/* sticky 클래스가 붙은 요소는 무조건 상단 고정 */
.sticky {
    position: sticky !important;
    /* 강제 적용 */
    position: -webkit-sticky !important;
    /* 사파리 호환 */
    top: 80px;
    z-index: 90;
    /* 다른 요소보다 위에 */
}

/* 메뉴와 타이틀이 겹치지 않게 배경색 지정 (투명하면 글자가 겹쳐 보임) */
#userNav.sticky,
#preview-title.sticky {
    background-color: var(--bg-color, #fff);
    /* 배경색 필수 */
    transition: top 0.1s ease;
    /* 위치 조정 시 부드럽게 */
}

/* 1. 스티키를 죽이는 부모 속성 강제 해제 */
body,
html {
    overflow-x: hidden;
    /* 가로 스크롤 방지는 유지 */
    overflow-y: auto;
    /* 세로 스크롤은 브라우저에게 맡김 */
}

/* 🚨 여기가 제일 중요합니다. 이게 hidden이면 sticky 안 됨 */
.preview-wrapper {
    overflow: visible !important;
    height: auto !important;
}

/* 2. 스티키 동작 정의 (JS 간섭 없이 CSS 변수로 통제) */
:root {
    --platform-header-height: 80px;
    /* 플랫폼 헤더 높이 */
    --user-nav-height: 0px;
    /* JS가 계산해서 넣어줄 메뉴 높이 */
}

/* 메뉴: 헤더 바로 아래(80px)에 고정 */
#userNav.sticky {
    position: sticky !important;
    position: -webkit-sticky !important;
    top: var(--platform-header-height) !important;
    z-index: 95;
    background-color: var(--bg-color, #fff);
    /* 투명하면 겹침 */
}

/* 타이틀: 헤더(80) + 메뉴높이(JS계산) 만큼 아래에 고정 */
#preview-title.sticky {
    position: sticky !important;
    position: -webkit-sticky !important;
    /* calc 함수로 겹침 원천 차단 */
    top: calc(var(--platform-header-height) + var(--user-nav-height)) !important;
    z-index: 90;
    background-color: var(--bg-color, #fff);
}

/*=========================================*/

/* 이름에 마우스 올렸을 때 색상 변경 */
.artist-name-link:hover {
    color: var(--text-secondary);
    /* 색상 코드 (#2563eb 등) */
    text-decoration: underline !important;
}

/* PC 화면(1025px 이상)이면서, 동시에 페이지 내에 '#dashboardSidebar'가 존재하는 경우 */
@media (min-width: 1025px) {
    body:has(#dashboardSidebar) .mobile-menu-btn {
        display: none !important;
    }
}

/* 컨테이너: 스크롤 영역 확보 및 화살표 가림 처리 */
.category-filters-container {
    width: 100%;
    overflow: hidden;
    /* 넘치는 부분 숨김 (스크롤바 등) */
    position: relative;
    margin-bottom: 3rem;
}

/* 실제 필터 목록 */
.category-filters {
    display: flex;
    gap: 0.8rem;
    overflow-x: auto;
    /* 가로 스크롤 허용 */
    white-space: nowrap;
    /* 줄바꿈 방지 */
    padding-bottom: 5px;
    /* 스크롤바 공간 살짝 확보 */

    /* 스크롤바 숨기기 (크롬, 사파리, 엣지) */
    -ms-overflow-style: none;
    /* IE, Edge */
    scrollbar-width: none;
    /* Firefox */
}

.category-filters::-webkit-scrollbar {
    display: none;
    /* Chrome, Safari */
}

/* 버튼 스타일 (기존 유지하되 flex-shrink 방지) */
.filter-btn {
    flex-shrink: 0;
    /* 공간 좁아져도 찌그러지지 않게 */
    /* ... 기존 스타일 ... */
}
