/* ===== 기본 설정 및 CSS 변수 ===== */
:root {
    /* 새로운 컬러 팔레트 */
    --color-1: #2cf6b3;
    --color-2: #2cf6b3;
    --color-3: #6e44ff;
    --color-4: #957fef;
    --color-5: #a682ff;
    
    /* 라이트 모드 색상 (기본) - 다크모드 비활성화 */
    --bg-primary: #FAFAFA;
    --bg-secondary: #FFFFFF;
    --bg-card: #FFFFFF;
    --text-primary: #1a1a1a;
    --text-secondary: #4B5563;
    --accent: #2cf6b3;
    --accent-hover: #25d69d;
    --border: #E5E7EB;
    --shadow: rgba(0, 0, 0, 0.1);
}

/* ⭐⭐⭐ 다크모드 완전 비활성화 - 모든 다크모드 스타일 무효화 ⭐⭐⭐ */
[data-theme="dark"],
body[data-theme="dark"],
html[data-theme="dark"] {
    /* 다크모드가 적용되어도 라이트모드 색상 강제 적용 */
    --bg-primary: #FAFAFA !important;
    --bg-secondary: #FFFFFF !important;
    --bg-card: #FFFFFF !important;
    --text-primary: #1a1a1a !important;
    --text-secondary: #4B5563 !important;
    --accent: #2cf6b3 !important;
    --accent-hover: #25d69d !important;
    --border: #E5E7EB !important;
    --shadow: rgba(0, 0, 0, 0.1) !important;
    
    /* 배경색과 텍스트 색상도 직접 강제 */
    background-color: #FAFAFA !important;
    color: #1a1a1a !important;
}

[data-theme="light"] {
    /* 라이트 모드 색상 */
    --bg-primary: #FAFAFA;
    --bg-secondary: #FFFFFF;
    --bg-card: #FFFFFF;
    --text-primary: #1a1a1a;
    --text-secondary: #4B5563;
    --accent: #2cf6b3;
    --accent-hover: #25d69d;
    --border: #E5E7EB;
    --shadow: rgba(0, 0, 0, 0.1);
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background-color: var(--bg-primary);
    color: var(--text-primary);
    overflow-x: hidden;
    transition: background-color 0.3s ease;
    margin: 0;
    padding: 0;
}

/* ⭐ 다크모드 강제 비활성화 - body에도 라이트모드 강제 적용 */
body[data-theme="dark"] {
    background-color: #FAFAFA !important;
    color: #1a1a1a !important;
}

/* ⭐ 모든 다크모드 선택자 무효화 - 깜빡임 완전 방지 */
[data-theme="dark"] * {
    /* CSS 변수가 이미 위에서 강제되었으므로, 모든 자식 요소는 라이트모드 색상을 사용 */
    transition: none !important; /* 전환 애니메이션도 비활성화 */
}

[data-theme="dark"] .sidebar,
[data-theme="dark"] .sidebar-link,
[data-theme="dark"] .main-content,
[data-theme="dark"] .template-card,
[data-theme="dark"] .menu-dropdown,
[data-theme="dark"] input,
[data-theme="dark"] button,
[data-theme="dark"] select,
[data-theme="dark"] textarea {
    /* 모든 요소가 라이트모드 CSS 변수를 사용하도록 강제됨 */
    /* 추가 스타일 필요 없음 - 위의 CSS 변수 강제로 충분 */
}

/* ===== 사이드바 ===== */
.sidebar {
    position: fixed;
    left: 0;
    top: 0;
    width: 85px;
    min-width: 85px;
    max-width: 85px;
    height: 100vh;
    z-index: 1000;
    background: linear-gradient(180deg, 
        rgba(44, 246, 179, 0.05) 0%, 
        rgba(44, 246, 179, 0.05) 50%, 
        rgba(44, 246, 179, 0.04) 65%, 
        rgba(110, 68, 255, 0.04) 80%, 
        rgba(110, 68, 255, 0.05) 100%
    );
    backdrop-filter: blur(10px);
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 0;
    z-index: 1000;
    transition: all 0.3s ease;
    border-right: 1px solid transparent;
    border-image: linear-gradient(180deg, 
        var(--color-1) 0%, 
        var(--color-1) 50%, 
        var(--color-1) 65%, 
        var(--color-3) 80%, 
        var(--color-3) 100%
    );
    border-image-slice: 1;
    box-shadow: none;
}

[data-theme="dark"] .sidebar {
    background: linear-gradient(180deg, 
        rgba(44, 246, 179, 0.08) 0%, 
        rgba(44, 246, 179, 0.08) 50%, 
        rgba(44, 246, 179, 0.06) 65%, 
        rgba(110, 68, 255, 0.06) 80%, 
        rgba(110, 68, 255, 0.08) 100%
    );
    box-shadow: none;
}

/* 사이드바 로고 */
.sidebar-logo {
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 15px 0;
}

.logo-link {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.4rem;
    width: 70px;
    min-height: 70px;
    text-decoration: none;
    color: var(--text-primary);
    transition: all 0.3s ease;
    border-radius: 12px;
}

.logo-link:hover {
    background: rgba(44, 246, 179, 0.08);
    transform: translateY(-2px);
}

.logo-link i {
    font-size: 1.8rem;
    color: var(--color-1);
    font-weight: 900;
    -webkit-text-stroke: 1.5px #3a3a3a;
}

.logo-text {
    font-size: 1.25rem;
    font-weight: 800;
    letter-spacing: 0.5px;
    background: linear-gradient(135deg, #2cf6b3 0%, #2cf6b3 50%, #6e44ff 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-align: center;
    width: 100%;
}

.sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: 15px;
    flex-grow: 1;
    width: 100%;
    align-items: center;
}

.sidebar-link {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.3rem;
    padding: 0.2rem;
    width: 70px;
    max-width: 70px;
    min-width: 70px;
    min-height: 70px;
    text-decoration: none;
    color: #4B5563;
    font-weight: 600;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border-radius: 12px;
    position: relative;
    border: none;
    background: transparent;
    box-sizing: border-box;
    overflow: hidden;
}

[data-theme="dark"] .sidebar-link {
    color: var(--color-1);
    opacity: 0.7;
}

/* 호버 효과 (카테고리 탭과 동일) */
.sidebar-link:hover {
    background: rgba(44, 246, 179, 0.08);
    transform: translateY(-2px);
    opacity: 1;
}

.sidebar-link:hover i {
    color: var(--color-2);
    filter: brightness(0.85);
}

.sidebar-link:hover .sidebar-text {
    color: var(--text-secondary);
}

/* 현재 선택된 탭 (카테고리 탭과 동일) */
.sidebar-link.active {
    background: rgba(44, 246, 179, 0.30);
    box-shadow: none;
}

.sidebar-link.active i {
    color: #2cf6b3;
    filter: brightness(0.85);
    -webkit-text-stroke: 1.5px #3a3a3a;
    font-weight: 900;
}

.sidebar-link.active .sidebar-text {
    /* color 제거 - 텍스트 색상 변화 없음 */
    /* font-weight 제거 - 텍스트 굵어지지 않음 */
}

[data-theme="light"] .sidebar-link.active {
    background: rgba(44, 246, 179, 0.30);
}

[data-theme="light"] .sidebar-link.active i {
    color: #2cf6b3;
    filter: brightness(0.85);
    -webkit-text-stroke: 1.5px #3a3a3a;
    font-weight: 900;
}

[data-theme="light"] .sidebar-link.active .sidebar-text {
    /* color 제거 - 텍스트 색상 변화 없음 */
    /* font-weight 제거 - 텍스트 굵어지지 않음 */
}

[data-theme="dark"] .sidebar-link.active {
    background: rgba(44, 246, 179, 0.30);
    box-shadow: none;
    opacity: 1;
}

[data-theme="dark"] .sidebar-link.active i {
    color: #2cf6b3;
    filter: brightness(0.85);
    -webkit-text-stroke: 0.2px currentColor;
    font-weight: 200;
}

[data-theme="dark"] .sidebar-link.active .sidebar-text {
    /* color 제거 - 텍스트 색상 변화 없음 */
    /* font-weight 제거 - 텍스트 굵어지지 않음 */
}

.sidebar-link i {
    font-size: 1.35rem;
    color: var(--color-1);
    font-weight: 900;
    -webkit-text-stroke: 1.5px #3a3a3a;
}

[data-theme="dark"] .sidebar-link i {
    font-weight: 200;
    -webkit-text-stroke: 0.2px currentColor;
}

.sidebar-text {
    font-size: 12px;
    font-weight: 600;
    text-align: center;
    line-height: 1.2;
    width: 100%;
    word-wrap: break-word;
    overflow-wrap: break-word;
    hyphens: auto;
}

/* 햄버거 메뉴 */
.menu-toggle {
    cursor: pointer;
    position: relative;
}

.menu-dropdown {
    display: none;
    position: fixed;
    left: 110px;
    bottom: 120px;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 0.5rem 0;
    min-width: 200px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    z-index: 999999;
}

[data-theme="light"] .menu-dropdown {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.menu-dropdown.active {
    display: block !important;
}

.dropdown-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    color: var(--text-primary);
    text-decoration: none;
    transition: all 0.3s ease;
}

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

[data-theme="light"] .dropdown-item:hover {
    background: rgba(110, 68, 255, 0.08);
}

.dropdown-item i {
    font-size: 1.2rem;
    color: var(--text-secondary);
}

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

.dropdown-item span {
    font-size: 0.9rem;
    font-weight: 500;
}

.sidebar-bottom {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 0;
    gap: 0;
}

/* 하단 버튼 아이콘 보라색 (설정, 테마, 햄버거) */
.sidebar-bottom .sidebar-link i,
.sidebar-bottom .menu-toggle i,
.sidebar-bottom .theme-toggle i {
    color: rgba(110, 68, 255, 0.5);
    -webkit-text-stroke: 1.5px #3a3a3a;
}

[data-theme="dark"] .sidebar-bottom .sidebar-link i,
[data-theme="dark"] .sidebar-bottom .menu-toggle i,
[data-theme="dark"] .sidebar-bottom .theme-toggle i {
    color: rgba(110, 68, 255, 0.5);
    -webkit-text-stroke: 0.2px rgba(110, 68, 255, 0.5);
}

/* 관리자 버튼 아이콘 보라색 (margin-top: auto로 하단 배치된 것) */
.sidebar-nav a[href="/admin"] i {
    color: rgba(110, 68, 255, 0.5);
    -webkit-text-stroke: 1.5px #3a3a3a;
}

[data-theme="dark"] .sidebar-nav a[href="/admin"] i {
    color: rgba(110, 68, 255, 0.5);
    -webkit-text-stroke: 0.2px rgba(110, 68, 255, 0.5);
}

/* 하단 버튼 호버 효과 - 보라색 */
.sidebar-bottom .sidebar-link:hover,
.sidebar-bottom .menu-toggle:hover,
.sidebar-nav a[href="/admin"]:hover {
    background: rgba(110, 68, 255, 0.08);
}

.sidebar-bottom .sidebar-link:hover i,
.sidebar-bottom .menu-toggle:hover i,
.sidebar-nav a[href="/admin"]:hover i {
    filter: brightness(0.8);
}

.sidebar-bottom .sidebar-link:hover .sidebar-text,
.sidebar-nav a[href="/admin"]:hover .sidebar-text {
    color: var(--text-secondary);
    /* font-weight 제거 - 호버 시에도 텍스트 굵어지지 않음 */
}

/* 하단 버튼 액티브 효과 - 보라색 */
.sidebar-bottom .sidebar-link.active,
.sidebar-bottom .menu-toggle.active,
.sidebar-nav a[href="/admin"].active {
    background: rgba(110, 68, 255, 0.30);
}

.sidebar-bottom .sidebar-link.active i,
.sidebar-bottom .menu-toggle.active i,
.sidebar-nav a[href="/admin"].active i {
    filter: brightness(0.8);
    color: rgba(110, 68, 255, 0.5);
    -webkit-text-stroke: 1.5px #3a3a3a;
}

[data-theme="light"] .sidebar-bottom .sidebar-link.active,
[data-theme="light"] .sidebar-bottom .menu-toggle.active,
[data-theme="light"] .sidebar-nav a[href="/admin"].active {
    background: rgba(110, 68, 255, 0.30);
}

[data-theme="light"] .sidebar-bottom .sidebar-link.active i,
[data-theme="light"] .sidebar-bottom .menu-toggle.active i,
[data-theme="light"] .sidebar-nav a[href="/admin"].active i {
    color: rgba(110, 68, 255, 0.5);
    filter: brightness(0.8);
    -webkit-text-stroke: 1.5px #3a3a3a;
}

[data-theme="dark"] .sidebar-bottom .sidebar-link.active,
[data-theme="dark"] .sidebar-bottom .menu-toggle.active,
[data-theme="dark"] .sidebar-nav a[href="/admin"].active {
    background: rgba(110, 68, 255, 0.30);
}

[data-theme="dark"] .sidebar-bottom .sidebar-link.active i,
[data-theme="dark"] .sidebar-bottom .menu-toggle.active i,
[data-theme="dark"] .sidebar-nav a[href="/admin"].active i {
    color: rgba(110, 68, 255, 0.5);
    filter: brightness(0.8);
    -webkit-text-stroke: 0.2px rgba(110, 68, 255, 0.5);
}

/* 하단 버튼 텍스트 색상 */
.sidebar-bottom .sidebar-link .sidebar-text,
.sidebar-nav a[href="/admin"] .sidebar-text {
    color: var(--text-secondary);
}

.sidebar-bottom .sidebar-link.active .sidebar-text,
.sidebar-nav a[href="/admin"].active .sidebar-text {
    /* color 제거 - 텍스트 색상 변화 없음 */
    /* font-weight 제거 - 텍스트 굵어지지 않음 */
}

[data-theme="light"] .sidebar-bottom .sidebar-link.active .sidebar-text,
[data-theme="light"] .sidebar-nav a[href="/admin"].active .sidebar-text {
    /* color 제거 - 텍스트 색상 변화 없음 */
    /* font-weight 제거 - 텍스트 굵어지지 않음 */
}

[data-theme="dark"] .sidebar-bottom .sidebar-link.active .sidebar-text,
[data-theme="dark"] .sidebar-nav a[href="/admin"].active .sidebar-text {
    /* color 제거 - 텍스트 색상 변화 없음 */
    /* font-weight 제거 - 텍스트 굵어지지 않음 */
}

/* 테마 토글 버튼 */
.theme-toggle {
    position: relative;
    border: none !important;
    outline: none !important;
    display: none !important; /* 테마 토글 숨김 */
}

.theme-icon-dark,
.theme-icon-light {
    transition: opacity 0.3s ease;
}

[data-theme="light"] .theme-icon-dark {
    display: none;
}

[data-theme="dark"] .theme-icon-light,
body:not([data-theme]) .theme-icon-light {
    display: none;
}

/* ===== 메인 콘텐츠 영역 ===== */
.main-content {
    margin-left: 105px;
    width: calc(100% - 105px);
    min-height: 100vh;
    padding: 0;
}

.page-container {
    max-width: 100%;
    margin: 0 auto;
    padding: 0 2rem;
}

/* ===== 카테고리 탭 (가로 스크롤) ===== */
.category-tabs-wrapper {
    margin-bottom: 24px;
    overflow-x: auto;
    scrollbar-width: thin;
    scrollbar-color: var(--accent) var(--bg-secondary);
}

.category-tabs-wrapper::-webkit-scrollbar {
    height: 6px;
}

.category-tabs-wrapper::-webkit-scrollbar-track {
    background: var(--bg-secondary);
    border-radius: 3px;
}

.category-tabs-wrapper::-webkit-scrollbar-thumb {
    background: var(--accent);
    border-radius: 3px;
}

.category-tabs {
    display: flex;
    gap: 12px;
    padding-bottom: 12px;
}

.category-tab {
    padding: 16px 24px;
    background-color: var(--bg-card);
    color: var(--text-secondary);
    border: 1px solid var(--border);
    border-radius: 8px;
    cursor: pointer;
    white-space: nowrap;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s ease;
}

.category-tab:hover {
    background-color: var(--accent);
    color: #ffffff;
    border-color: var(--accent);
    transform: translateY(-2px);
}

.category-tab.active {
    background-color: var(--accent);
    color: #ffffff;
    border-color: var(--accent);
}

/* ===== 검색 및 필터 섹션 ===== */
.search-filter-section {
    display: flex;
    gap: 16px;
    margin-bottom: 32px;
    align-items: center;
    flex-wrap: wrap;
}

.search-bar {
    flex: 1;
    min-width: 300px;
    position: relative;
    display: flex;
    align-items: center;
}

.search-bar i {
    position: absolute;
    left: 16px;
    color: var(--text-secondary);
    font-size: 20px;
}

.search-bar input {
    width: 100%;
    padding: 14px 16px 14px 48px;
    background-color: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    color: var(--text-primary);
    font-size: 16px;
    transition: all 0.3s ease;
}

.search-bar input:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.media-toggle {
    display: flex;
    gap: 8px;
}

.toggle-btn {
    padding: 12px 20px;
    background-color: var(--bg-card);
    color: var(--text-secondary);
    border: 1px solid var(--border);
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    transition: all 0.3s ease;
}

.toggle-btn:hover {
    background-color: var(--accent);
    color: #ffffff;
    border-color: var(--accent);
}

.toggle-btn.active {
    background-color: var(--accent);
    color: #ffffff;
    border-color: var(--accent);
}

/* ===== 템플릿 그리드 (반응형 4열) ===== */
.templates-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 24px;
}

.template-card {
    background-color: transparent;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    /* aspect-ratio는 JavaScript에서 동적으로 설정됨 */
}

.template-card:hover {
    transform: scale(1.05);
}

.template-thumbnail {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
}

.template-thumbnail img,
.template-thumbnail video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.template-card:hover .template-thumbnail img,
.template-card:hover .template-thumbnail video {
    transform: scale(1.1);
}

.template-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.template-card:hover .template-overlay {
    opacity: 1;
}

.btn-use {
    padding: 10px 24px;
    background-color: var(--accent);
    color: #ffffff;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-use:hover {
    background-color: var(--accent-hover);
    transform: scale(1.05);
}

.template-info {
    padding: 16px;
}

.template-name {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
}

/* ===== 하위 탭 (create.html) ===== */
.sub-tabs-wrapper {
    margin-bottom: 32px;
}

.sub-tabs {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.sub-tab {
    padding: 14px 24px;
    background-color: var(--bg-card);
    color: var(--text-secondary);
    border: 1px solid var(--border);
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s ease;
}

.sub-tab:hover {
    background-color: var(--accent);
    color: #ffffff;
    border-color: var(--accent);
}

.sub-tab.active {
    background-color: var(--accent);
    color: #ffffff;
    border-color: var(--accent);
}

/* ===== 업로드 영역 (create.html) ===== */
.create-main {
    margin-top: 32px;
}

.upload-area {
    background-color: var(--bg-card);
    border: 2px dashed var(--border);
    border-radius: 12px;
    padding: 64px 32px;
    text-align: center;
    transition: all 0.3s ease;
}

.upload-area:hover {
    border-color: var(--accent);
    background-color: rgba(59, 130, 246, 0.05);
}

.upload-icon {
    font-size: 64px;
    color: var(--accent);
    margin-bottom: 16px;
}

.upload-area h2 {
    font-size: 24px;
    margin-bottom: 8px;
}

.upload-area p {
    color: var(--text-secondary);
    margin-bottom: 24px;
}

.btn-primary {
    padding: 12px 32px;
    background-color: var(--accent);
    color: #ffffff;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-primary:hover {
    background-color: var(--accent-hover);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

.btn-primary.btn-large {
    padding: 16px 48px;
    font-size: 18px;
}

.btn-secondary {
    padding: 12px 24px;
    background-color: var(--bg-card);
    color: var(--text-primary);
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 14px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s ease;
}

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

/* ===== 미리보기 영역 ===== */
.preview-area {
    margin-top: 32px;
}

.preview-area h3 {
    margin-bottom: 16px;
}

.preview-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 16px;
    margin-bottom: 32px;
}

.preview-item {
    position: relative;
    aspect-ratio: 1;
    border-radius: 8px;
    overflow: hidden;
    transition: all 0.3s ease;
}

.preview-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.preview-item .remove-btn {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 32px;
    height: 32px;
    background-color: rgba(220, 38, 38, 0.9);
    color: #ffffff;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    opacity: 0;
    transition: all 0.3s ease;
}

.preview-item:hover .remove-btn {
    opacity: 1;
}

.preview-item .remove-btn:hover {
    background-color: rgba(220, 38, 38, 1);
    transform: scale(1.1);
}

.generation-options {
    background-color: var(--bg-card);
    padding: 24px;
    border-radius: 12px;
    margin-top: 24px;
}

.generation-options h3 {
    margin-bottom: 16px;
}

.option-group {
    margin-bottom: 20px;
}

.option-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
}

.form-select,
.form-textarea {
    width: 100%;
    padding: 12px;
    background-color: var(--bg-primary);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text-primary);
    font-size: 14px;
    transition: all 0.3s ease;
}

.form-select:focus,
.form-textarea:focus {
    outline: none;
    border-color: var(--accent);
}

/* ===== 편집 페이지 (edit.html) ===== */
.edit-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
}

.edit-header h1 {
    font-size: 28px;
}

.edit-actions {
    display: flex;
    gap: 12px;
}

.edit-workspace {
    display: grid;
    grid-template-columns: 250px 1fr 250px;
    gap: 24px;
    height: calc(100vh - 160px);
}

.tools-panel,
.properties-panel {
    background-color: var(--bg-card);
    padding: 20px;
    border-radius: 12px;
    overflow-y: auto;
}

.tools-panel h3,
.properties-panel h3 {
    margin-bottom: 16px;
}

.tool-group {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
    margin-bottom: 20px;
}

.tool-btn {
    padding: 12px;
    background-color: var(--bg-primary);
    color: var(--text-secondary);
    border: 1px solid var(--border);
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    font-size: 12px;
    transition: all 0.3s ease;
}

.tool-btn i {
    font-size: 20px;
}

.tool-btn:hover,
.tool-btn.active {
    background-color: var(--accent);
    color: #ffffff;
    border-color: var(--accent);
}

.canvas-area {
    background-color: var(--bg-card);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.canvas-container {
    max-width: 100%;
    max-height: 100%;
}

.canvas-container img {
    max-width: 100%;
    max-height: 100%;
    display: block;
}

.property-group {
    margin-bottom: 20px;
}

.property-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
}

.slider {
    width: 100%;
    height: 6px;
    background: var(--bg-primary);
    border-radius: 3px;
    outline: none;
    appearance: none;
    -webkit-appearance: none;
}

.slider::-webkit-slider-thumb {
    appearance: none;
    -webkit-appearance: none;
    width: 16px;
    height: 16px;
    background: var(--accent);
    cursor: pointer;
    border-radius: 50%;
}

.slider::-moz-range-thumb {
    width: 16px;
    height: 16px;
    background: var(--accent);
    cursor: pointer;
    border-radius: 50%;
    border: none;
}

/* ===== 내 작업 페이지 (mywork.html) ===== */
.mywork-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 32px;
}

.mywork-header h1 {
    font-size: 28px;
}

.filter-group {
    display: flex;
    gap: 8px;
}

.filter-btn {
    padding: 10px 20px;
    background-color: var(--bg-card);
    color: var(--text-secondary);
    border: 1px solid var(--border);
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.3s ease;
}

.filter-btn:hover,
.filter-btn.active {
    background-color: var(--accent);
    color: #ffffff;
    border-color: var(--accent);
}

.mywork-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 24px;
}

.work-card {
    background-color: var(--bg-card);
    border-radius: 12px;
    overflow: hidden;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px var(--shadow);
}

.work-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px var(--shadow);
}

.work-thumbnail {
    position: relative;
    aspect-ratio: 16 / 9;
}

.work-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.work-badge {
    position: absolute;
    top: 12px;
    right: 12px;
    background-color: rgba(0, 0, 0, 0.7);
    color: #ffffff;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 18px;
}

.work-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.work-card:hover .work-overlay {
    opacity: 1;
}

.btn-icon {
    width: 40px;
    height: 40px;
    background-color: var(--accent);
    color: #ffffff;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    transition: all 0.3s ease;
}

.btn-icon:hover {
    background-color: var(--accent-hover);
    transform: scale(1.1);
}

.work-info {
    padding: 16px;
}

.work-title {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 4px;
}

.work-date {
    font-size: 12px;
    color: var(--text-secondary);
}

/* ===== 반응형 디자인 ===== */
/* 태블릿 (768px ~ 1024px) */
@media (max-width: 1024px) {
    .templates-grid,
    .mywork-grid {
        grid-template-columns: repeat(3, 1fr);
    }
    
    .edit-workspace {
        grid-template-columns: 200px 1fr 200px;
    }
}

/* 모바일 (max-width: 768px) */
@media (max-width: 768px) {
    /* 사이드바를 하단으로 이동 */
    .sidebar {
        top: auto;
        bottom: 0;
        left: 0;
        right: 0;
        width: 100%;
        min-width: 100%;
        max-width: 100%;
        height: 70px;
        flex-direction: row;
        padding: 0;
        background: var(--bg-primary);
        backdrop-filter: none;
        box-shadow: none; /* 그림자 제거 */
        border-top: none; /* 상단 테두리 제거 */
        border-right: none;
        z-index: 2000;
    }
    
    .sidebar-nav {
        flex-direction: row;
        width: 100%;
        justify-content: space-around;
        padding: 0;
        gap: 0;
        overflow-x: auto;
    }
    
    .sidebar-link {
        flex: 1;
        min-width: 60px;
        width: auto;
        max-width: none;
        min-height: 60px;
        padding: 0.2rem 0.15rem;
        gap: 0.2rem;
    }
    
    .sidebar-link i {
        font-size: 1.3rem; /* 원래대로 */
    }
    
    .sidebar-text {
        font-size: 10px; /* 13px → 10px (20% 감소) */
    }
    
    /* 로고를 하단바에 표시 */
    .sidebar-logo {
        display: flex;
        flex: 1;
    }
    
    .logo-link {
        flex: 1;
        min-width: 60px;
        width: 60px;
        max-width: 80px;
        min-height: 60px;
        padding: 0.5rem 0.25rem;
        gap: 0.25rem;
    }
    
    .logo-link i {
        font-size: 1.3rem;
        -webkit-text-stroke: 2px #3a3a3a;
    }
    
    .logo-text {
        font-size: 10px;
    }
    
    .sidebar-bottom {
        display: none;
    }
    
    /* 메인 컨텐츠 조정 */
    .main-content {
        margin-left: 0;
        margin-bottom: 70px;
        width: 100%;
        padding: 0.5rem;
    }
    
    .templates-grid,
    .mywork-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 16px;
    }
    
    .category-tabs {
        gap: 8px;
    }
    
    .category-tab {
        padding: 12px 16px;
        font-size: 13px;
    }
    
    .search-filter-section {
        flex-direction: column;
        gap: 12px;
    }
    
    .search-bar {
        min-width: 100%;
    }
    
    .edit-workspace {
        grid-template-columns: 1fr;
        height: auto;
    }
    
    .tools-panel,
    .properties-panel {
        display: none;
    }
}

/* ===== 로딩 애니메이션 ===== */
@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}
