:root {
    --primary-color: #4150F8;
    --dark-bg: #1a1a1a;
    --sidebar-width: 100px;
    --header-height: 60px;
    --section-gap: 10px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Noto Sans KR', sans-serif;
}

body {
    background-color: var(--dark-bg);
    color: #fff;
    display: flex;
    height: 100vh;
    overflow: hidden;
}

/* GNB - 사이드바 */
.gnb {
    width: var(--sidebar-width);
    height: 100vh;
    background-color: #222;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding-top: 15px;
    z-index: 10;
}

.gnb-item {
    width: 40px;
    height: 40px;
    margin: 10px 0;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    border-radius: 8px;
    color: #aaa;
    font-size: 20px;
}

.gnb-item:hover, .gnb-item.active {
    background-color: var(--primary-color);
    color: white;
}

.gnb-logo {
    height: 35px;
    width: auto;
    margin-bottom: 20px;
}

/* 메인 콘텐츠 영역 */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    height: 100vh;
    overflow: hidden;
}

/* 헤더 영역 */
.header {
    height: var(--header-height);
    background-color: #222;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 20px;
    border-bottom: 1px solid #333;
}

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

.brand-title {
    font-size: 20px;
    font-weight: 700;
    color: var(--primary-color);
    margin: 0;
}

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

.search-container {
    width: 40%; /* 고정 너비로 변경 */
    display: flex;
    align-items: center;
    margin: 0 20px;
}

.search-input {
    flex: 1;
    height: 38px;
    background-color: #333;
    border: none;
    border-radius: 4px;
    padding: 0 15px;
    color: white;
    font-size: 14px;
}

.action-buttons {
    display: flex;
    align-items: center;
    gap: 12px;
}

.action-button {
    margin-left: 15px;
    background-color: #333;
    border: none;
    color: white;
    padding: 8px 15px;
    border-radius: 4px;
    cursor: pointer;
    display: flex;
    align-items: center;
    font-size: 14px;
}

.action-button:hover {
    background-color: #444;
}

.action-spacer {
    flex: 1; /* 남은 공간을 모두 차지하여 사용자 정보를 오른쪽으로 밀어냄 */
}

/* Stock 섹션 헤더 스타일 */
.stock-header-left {
    display: flex;
    align-items: center;
}

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

.stock-search-container {
    display: flex;
    align-items: center;
}

.stock-search-input {
    width: 200px;
    height: 32px;
    background-color: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 4px;
    padding: 0 12px;
    color: white;
    font-size: 13px;
}

.stock-search-input:focus {
    outline: none;
    border-color: rgba(255, 255, 255, 0.4);
    background-color: rgba(255, 255, 255, 0.15);
}

.stock-search-input::placeholder {
    color: rgba(255, 255, 255, 0.6);
}

.stock-action-button {
    background-color: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: white;
    padding: 6px 12px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
    transition: all 0.2s ease;
}

.stock-action-button:hover {
    background-color: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.3);
}

.stock-action-button:active {
    transform: scale(0.95);
}

/* 미디어 쿼리 - 작은 화면에서 Stock 헤더 조정 */
@media (max-width: 768px) {
    .stock-header-right {
        flex-direction: column;
        gap: 5px;
    }
    
    .stock-search-input {
        width: 150px;
        font-size: 12px;
    }
    
    .stock-action-button {
        font-size: 11px;
        padding: 5px 10px;
    }
    
    .brand-title {
        font-size: 18px;
    }
}

/* 그리드 레이아웃 - 기본 구조 */
.grid-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    grid-template-rows: 70% 30%;
    gap: var(--section-gap);
    height: calc(100vh - var(--header-height));
    padding: var(--section-gap);
}

/* 그리드 아이템 기본 스타일 */
.grid-item {
    background-color: #222;
    border-radius: 5px;
    overflow: hidden;
    position: relative;
    display: flex;
    flex-direction: column;
}

/* 그리드 헤더 스타일 */
.grid-header {
    background-color: var(--primary-color);
    padding: 10px 15px;
    font-weight: bold;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-shrink: 0; /* 헤더 크기 고정 */
}

/* 헤더 버튼들 컨테이너 */
.header-buttons {
    display: flex;
    align-items: center;
    gap: 8px;
}

/* 더 보기 버튼 스타일 */
.more-button {
    background: none;
    border: none;
    color: white;
    cursor: pointer;
    padding: 6px 10px;
    border-radius: 4px;
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 12px;
    transition: all 0.2s ease;
    opacity: 0.8;
}

.more-button:hover {
    background-color: rgba(255, 255, 255, 0.1);
    opacity: 1;
    transform: translateX(2px);
}

.more-button:active {
    transform: scale(0.95);
}

.more-button svg {
    transition: transform 0.2s ease;
}

.more-button:hover svg {
    transform: translateX(2px);
}

/* 새로고침 버튼 스타일 */
.refresh-button {
    background: none;
    border: none;
    color: white;
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    opacity: 0.8;
}

.refresh-button:hover {
    background-color: rgba(255, 255, 255, 0.1);
    opacity: 1;
    transform: scale(1.1);
}

.refresh-button:active {
    transform: scale(0.95);
}

.refresh-button svg {
    transition: transform 0.3s ease;
}

.refresh-button:hover svg {
    transform: rotate(180deg);
}

/* 개별 영역 크기 조정 */
/* Main-1 Stock - 최대한 크게 */
.grid-item:nth-child(1) {
    grid-column: 1;
    grid-row: 1;
}

/* Main-2 나의 생성 기록 - Stock 아래에 위치 */
.grid-item:nth-child(2) {
    grid-column: 1;
    grid-row: 2;
}

/* Main-3 Preview - 우측 상단에 위치하고 높이 제한 */
.grid-item:nth-child(3) {
    grid-column: 2;
    grid-row: 1;
    max-height: 35vh;
}

/* Main-4 Export - 우측 하단에 더 넓은 공간 확보 */
.grid-item:nth-child(4) {
    grid-column: 2;
    grid-row: 1 / span 2;
    margin-top: calc(35vh + var(--section-gap));
}

/* 영역별 내부 스크롤 설정 */
.grid-content {
    flex: 1;
    overflow: auto;
    padding: 10px;
}

/* Stock 영역 스타일 특별 처리 */
.grid-item:nth-child(1) {
    display: flex;
    flex-direction: column;
    height: 100%; /* 컨테이너 높이 채우기 */
    -webkit-overflow-scrolling: touch; /* 모바일 스크롤 부드럽게 */
}

.grid-item:nth-child(1) .grid-content {
    overflow-y: auto; /* 수직 스크롤 활성화 */
    height: calc(100% - 45px); /* 헤더 높이(대략 45px) 제외한 높이 */
    padding-right: 10px; /* 스크롤바 공간 확보 */
    background-color: #1d1d1d; /* 약간 더 어두운 배경 */
    -webkit-overflow-scrolling: touch; /* 모바일 스크롤 부드럽게 */
}

/* 스크롤바 스타일링 */
.grid-item:nth-child(1) .grid-content::-webkit-scrollbar {
    width: 8px;
}

.grid-item:nth-child(1) .grid-content::-webkit-scrollbar-track {
    background: #2a2a2a;
    border-radius: 4px;
}

.grid-item:nth-child(1) .grid-content::-webkit-scrollbar-thumb {
    background: #444;
    border-radius: 4px;
}

.grid-item:nth-child(1) .grid-content::-webkit-scrollbar-thumb:hover {
    background: #555;
}

/* 나의 생성 기록 영역도 스크롤 가능하도록 설정 */
.grid-item:nth-child(2) {
    display: flex;
    flex-direction: column;
    height: 100%;
    -webkit-overflow-scrolling: touch;
}

.grid-item:nth-child(2) .grid-content {
    overflow-y: auto;
    height: calc(100% - 45px);
    padding-right: 10px;
    background-color: #1d1d1d;
    -webkit-overflow-scrolling: touch;
}

/* 나의 생성 기록 영역 스크롤바 스타일링 */
.grid-item:nth-child(2) .grid-content::-webkit-scrollbar {
    width: 8px;
}

.grid-item:nth-child(2) .grid-content::-webkit-scrollbar-track {
    background: #2a2a2a;
    border-radius: 4px;
}

.grid-item:nth-child(2) .grid-content::-webkit-scrollbar-thumb {
    background: #444;
    border-radius: 4px;
}

.grid-item:nth-child(2) .grid-content::-webkit-scrollbar-thumb:hover {
    background: #555;
}

/* Main-1 Stock */
.stock-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr); /* 한 줄에 2개씩 표시 */
    gap: 15px; /* 간격 좀 더 넓게 */
    padding: 5px;
    width: 100%;
    min-height: 300px; /* 최소 높이 설정 */
}

.stock-item {
    position: relative;
    border-radius: 4px;
    overflow: hidden;
    cursor: pointer;
    /* 16:9 비율을 위한 패딩 설정 */
    padding-top: 56.25%; /* 16:9 비율 (9/16 = 0.5625 = 56.25%) */
}

.stock-item img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.2s;
}

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

.stock-item.selected {
    box-shadow: 0 0 0 3px var(--primary-color);
}

/* Main-2 Preview */
.preview-container {
    display: flex;
    flex-direction: column;
    height: 100%;
    align-items: center;
    justify-content: center;
    padding: 15px;
}

.preview-image {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    border-radius: 4px;
    border: 1px solid #333;
    background-color: #1a1a1a;
}

/* 헤더에 있는 Preview 버튼 스타일 */
.grid-header .preview-button {
    background-color: #333;
    color: white;
    border: none;
    padding: 6px 12px;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 12px;
    display: flex;
    align-items: center;
}

.grid-header .preview-button:hover {
    background-color: #444;
}

.grid-header .preview-button.reset-selection {
    background-color: #555;
}

.grid-header .preview-button.reset-selection:hover {
    background-color: #666;
}

/* 기존 Prompt 섹션 스타일은 제거됨 - 이제 Export 섹션에서 처리 */

/* Main-4 Export */
.export-container {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.export-video {
    flex: 1;
    width: 100%;
    background-color: #111;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    font-size: 14px;
    color: #666;
    padding: 10px;
}

.export-controls {
    padding: 20px;
}

/* 영상 설정 한 줄 배치 */
.video-settings-row {
    display: flex;
    gap: 15px;
    margin-bottom: 15px;
}

.video-settings-row .half-width {
    flex: 1;
    margin-bottom: 0;
}

.export-button {
    background-color: var(--primary-color);
    color: white;
    border: none;
    padding: 12px 20px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 16px;
    font-weight: 500;
    margin-top: 10px;
    width: 100%;
}

.export-button:hover {
    background-color: #6699ff;
}

.storage-section {
    margin-top: 20px;
    padding: 15px;
    background-color: #2a2a2a;
    border-radius: 4px;
}

.storage-title {
    font-size: 16px;
    font-weight: bold;
    margin-bottom: 15px;
    color: #ddd;
}

.storage-items {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 10px;
    max-height: 200px;
    overflow-y: auto;
}

.storage-item {
    background-color: #333;
    border-radius: 4px;
    padding: 8px;
    cursor: pointer;
    transition: background-color 0.2s;
    position: relative;
}

.storage-item:hover {
    background-color: #444;
}

.storage-item img {
    width: 100%;
    height: 80px;
    object-fit: cover;
    border-radius: 2px;
    margin-bottom: 5px;
}

.storage-item-status {
    font-size: 10px;
    padding: 2px 5px;
    border-radius: 2px;
    margin-bottom: 3px;
    text-align: center;
}

.storage-item-status.completed {
    background-color: #4caf50;
    color: white;
}

.storage-item-status.pending {
    background-color: #ff9800;
    color: white;
}

.storage-item-status.failed {
    background-color: #f44336;
    color: white;
}

.storage-item-model {
    font-size: 10px;
    color: #aaa;
    text-align: center;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.storage-item.more {
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #1a1a1a;
    border: 2px dashed #444;
}

.more-text {
    color: #666;
    font-size: 12px;
}

/* 로딩 컨테이너 */
.loading-container {
    grid-column: 1 / -1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 20px;
    color: #666;
}

.loading-spinner {
    width: 20px;
    height: 20px;
    border: 2px solid #333;
    border-top: 2px solid #666;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 10px;
}

.loading-text {
    font-size: 12px;
}

/* 빈 비디오 상태 스타일 */
.empty-videos {
    grid-column: 1 / -1;
    text-align: center;
    padding: 30px 20px;
    color: #666;
}

.empty-text {
    font-size: 14px;
    margin-bottom: 8px;
    color: #888;
}

.empty-subtext {
    font-size: 12px;
    color: #666;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* 페이지네이션 스타일 */
.pagination-controls {
    display: flex;
    align-items: center;
    margin-left: auto;
}

.pagination-btn {
    background-color: #333;
    color: white;
    border: none;
    border-radius: 4px;
    width: 30px;
    height: 30px;
    font-size: 16px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 5px;
}

.pagination-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.pagination-btn:hover:not(:disabled) {
    background-color: #444;
}

.pagination-info {
    font-size: 14px;
    margin: 0 10px;
}

/* 로딩 및 에러 메시지 스타일 */
.loading, .error-message, .loading-indicator {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    color: #aaa;
    text-align: center;
    border-radius: 4px;
}

.loading {
    height: 150px;
    background-color: #2a2a2a;
}

.loading-indicator {
    grid-column: 1 / span 2; /* 그리드 전체 너비 차지 */
    height: 50px;
    padding: 10px;
    margin-top: 10px;
    background-color: #2a2a2a;
    position: relative;
}

/* 로딩 애니메이션 추가 */
.loading-indicator::after {
    content: '';
    display: block;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    border: 2px solid #ddd;
    border-top-color: var(--primary-color);
    position: absolute;
    left: calc(50% - 10px);
    animation: spin 1s linear infinite;
}

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

.error-message {
    color: #b71c1c;
    font-size: 1em;
    line-height: 1.5;
    margin: 10px 0;
    padding: 12px;
    background: rgba(255, 255, 255, 0.7);
    border-radius: 8px;
    border-left: 4px solid #f44336;
}

.error-suggestion {
    color: #1976d2;
    font-size: 0.95em;
    margin-top: 15px;
    padding: 10px;
    background: rgba(33, 150, 243, 0.1);
    border-radius: 8px;
    border-left: 4px solid #6699ff;
}

.error-suggestion::before {
    content: "💡 ";
}

/* Stock 그리드 빈 상태 표시 */
.stock-grid:empty {
    min-height: 300px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #666;
    font-size: 14px;
}

.stock-grid:empty::after {
    content: '이미지 로딩 중...';
}

/* 영상 생성 폼 스타일 */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    color: #aaa;
    font-size: 14px;
}

.form-control {
    width: 100%;
    padding: 8px;
    background-color: #333;
    border: none;
    border-radius: 4px;
    color: white;
    font-size: 14px;
}

.checkbox {
    display: flex;
    align-items: center;
}

.checkbox input {
    margin-right: 8px;
}

/* 진행 상태 표시 영역 */
.progress-area {
    padding: 20px;
    background-color: #2a2a2a;
    border-radius: 4px;
    margin-top: 20px;
}

.progress-status {
    font-size: 16px;
    margin-bottom: 10px;
    text-align: center;
    color: #ddd;
}

/* 결과 표시 영역 */
.result-area {
    padding: 20px;
    background-color: #2a2a2a;
    border-radius: 4px;
    margin-top: 20px;
}

/* 로딩바 숨김 */
.progress-bar {
    display: none;
}

.progress-bar-inner {
    display: none;
}

.cancel-button {
    background-color: #c62828;
    color: white;
    border: none;
    padding: 8px 15px;
    border-radius: 4px;
    cursor: pointer;
    display: block;
    margin: 0 auto;
}

.cancel-button:hover {
    background-color: #b71c1c;
}

/* 결과 영상 영역 */
.result-area {
    margin-top: 20px;
}

.result-video {
    width: 100%;
    max-width: 100%;
    height: auto;
    border-radius: 4px;
    background-color: #000;
    margin-bottom: 0;
}

.result-actions {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-top: 15px;
}

.result-actions .export-button {
    flex: 1;
    max-width: 120px;
}

/* 프롬프트 태그 스타일 */
.prompt-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    margin-top: 10px;
}

.prompt-tag {
    background-color: #333;
    color: white;
    padding: 5px 10px;
    border-radius: 20px;
    font-size: 12px;
    cursor: pointer;
    transition: background-color 0.2s;
}

.prompt-tag:hover {
    background-color: #444;
}

.prompt-tag.selected {
    background-color: var(--primary-color);
}

.form-group select {
    width: 100%;
    padding: 8px 12px;
    background-color: #333;
    border: none;
    border-radius: 4px;
    color: white;
    font-size: 14px;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background-image: url("data:image/svg+xml;utf8,<svg fill='white' height='24' viewBox='0 0 24 24' width='24' xmlns='http://www.w3.org/2000/svg'><path d='M7 10l5 5 5-5z'/><path d='M0 0h24v24H0z' fill='none'/></svg>");
    background-repeat: no-repeat;
    background-position: right 8px center;
    cursor: pointer;
}

.form-group select:focus {
    outline: none;
    box-shadow: 0 0 0 2px rgba(76, 175, 80, 0.4);
}

.form-group select option {
    background-color: #333;
    color: white;
}

/* 비디오 저장소 영역 */
.storage-container {
    margin-top: 30px;
    border-top: 1px solid #444;
    padding-top: 20px;
}

.storage-title {
    font-size: 18px;
    font-weight: bold;
    margin-bottom: 15px;
    color: #eee;
}

.storage-items {
    display: flex;
    flex-wrap: nowrap;
    overflow-x: auto;
    gap: 15px;
    padding-bottom: 10px;
    scrollbar-width: thin;
    scrollbar-color: #666 #222;
}

.storage-items::-webkit-scrollbar {
    height: 8px;
}

.storage-items::-webkit-scrollbar-track {
    background: #222;
    border-radius: 4px;
}

.storage-items::-webkit-scrollbar-thumb {
    background-color: #666;
    border-radius: 4px;
}

.storage-item {
    min-width: 200px;
    max-width: 200px;
    height: 150px;
    background-color: #333;
    border-radius: 8px;
    overflow: hidden;
    position: relative;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    flex-shrink: 0;
}

.storage-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
}

.storage-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: opacity 0.2s ease;
}

.storage-item:hover img {
    opacity: 0.7;
}

.storage-item-status {
    position: absolute;
    top: 10px;
    right: 10px;
    padding: 3px 8px;
    border-radius: 10px;
    font-size: 12px;
    color: white;
    background-color: rgba(0, 0, 0, 0.6);
}

.storage-item-status.completed {
    background-color: rgba(0, 150, 0, 0.7);
}

.storage-item-status.running {
    background-color: rgba(255, 165, 0, 0.7);
}

.storage-item-status.pending {
    background-color: rgba(100, 100, 100, 0.7);
}

.storage-item-status.failed {
    background-color: rgba(200, 0, 0, 0.7);
}

.storage-item-model {
    position: absolute;
    bottom: 10px;
    left: 10px;
    padding: 3px 8px;
    border-radius: 10px;
    font-size: 12px;
    color: white;
    background-color: rgba(0, 0, 0, 0.6);
}

.storage-item.more {
    display: flex;
    justify-content: center;
    align-items: center;
    background-color: #444;
}

.more-text {
    color: #ddd;
    font-size: 16px;
}

/* 비디오 정보 표시 */
.video-info {
    margin-top: 15px;
    padding: 15px;
    background-color: #333;
    border-radius: 8px;
}

.video-info-item {
    margin-bottom: 8px;
    color: #ddd;
    font-size: 14px;
}

.video-info-item:last-child {
    margin-bottom: 0;
}

/* 반응형 디자인 */
@media (max-width: 768px) {
    .storage-item {
        min-width: 150px;
        height: 120px;
    }
    
    .storage-items {
        gap: 10px;
    }
    
    .video-info-grid {
        grid-template-columns: 1fr;
        gap: 8px;
    }
    
    .video-info-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 4px;
    }
    
    .info-value {
        text-align: left;
    }
    
    .video-info-section, .prompt-info-section {
        padding: 12px;
    }
}

/* 저장된 비디오 정보 표시 */
.saved-video-info {
    margin-top: 15px;
    padding: 0;
    width: 100%;
}

.video-info-section, .prompt-info-section {
    background-color: #333;
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 15px;
}

.info-title {
    color: #ddd;
    font-size: 16px;
    font-weight: bold;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid #444;
}

.video-info-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.video-info-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
}

.info-label {
    color: #aaa;
    font-size: 14px;
    font-weight: 500;
}

.info-value {
    color: #ddd;
    font-size: 14px;
    text-align: right;
}

.info-value.status-completed {
    color: #4caf50;
    font-weight: bold;
}

.info-value.status-pending {
    color: #ff9800;
    font-weight: bold;
}

.info-value.status-running {
    color: #6699ff;
    font-weight: bold;
}

.info-value.status-failed {
    color: #f44336;
    font-weight: bold;
}

.info-value.status-canceled {
    color: #9e9e9e;
    font-weight: bold;
}

.prompt-text {
    background-color: #2a2a2a;
    border-radius: 4px;
    padding: 12px;
    color: #ddd;
    font-size: 14px;
    line-height: 1.5;
    border-left: 3px solid var(--primary-color);
    white-space: pre-wrap;
    word-wrap: break-word;
}

/* 전용 옵션 스타일 */
.option-group {
    margin-bottom: 20px;
}

.option-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: 500;
    color: #ccc;
    font-size: 14px;
}

.option-group textarea.form-control {
    resize: vertical;
    min-height: 50px;
    font-family: 'Noto Sans KR', Arial, sans-serif;
    line-height: 1.4;
    padding: 10px;
    background-color: #2a2a2a;
    border: 1px solid #444;
    border-radius: 4px;
    color: #ddd;
}

.option-group textarea.form-control:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(0, 123, 255, 0.2);
}

.option-group .form-text {
    font-size: 11px;
    color: #888;
    margin-top: 5px;
    line-height: 1.3;
}

/* 옵션 그룹 숨김 처리 */
.option-group[style*="display: none"] {
    display: none !important;
}

/* Export 섹션 내 프롬프트 텍스트 영역 스타일 */
.export-controls .prompt-textarea {
    width: 100%;
    background-color: #2a2a2a;
    border: 1px solid #444;
    border-radius: 4px;
    color: #ddd;
    font-family: 'Noto Sans KR', Arial, sans-serif;
    font-size: 14px;
    line-height: 1.4;
    padding: 12px;
    resize: vertical;
    min-height: 100px;
    max-height: 200px;
}

.export-controls .prompt-textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(0, 123, 255, 0.2);
}

.export-controls .prompt-textarea::placeholder {
    color: #888;
}

/* 프롬프트 헬퍼 기본 스타일 */
.prompt-helper {
    margin-bottom: 15px;
    overflow: hidden;
}

/* 프롬프트 텍스트에어리어 스타일 */
.prompt-textarea {
    min-height: 80px !important;
    resize: vertical;
    font-family: 'Courier New', monospace;
    font-size: 14px;
    line-height: 1.5;
    border: 2px solid #444 !important;
    transition: border-color 0.2s ease;
}

.prompt-textarea:focus {
    border-color: #4CAF50 !important;
    box-shadow: 0 0 0 3px rgba(76, 175, 80, 0.1);
}

.prompt-textarea.enhanced {
    background-color: #2a2a2a;
    border-color: #4CAF50;
    box-shadow: 0 0 0 2px rgba(76, 175, 80, 0.2);
}

/* 네거티브 프롬프트 토글 헤더 */
.negative-prompt-header-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: pointer;
    padding: 10px;
    background-color: #333;
    border-radius: 6px;
    border: 1px solid #555;
    margin-bottom: 10px;
    transition: all 0.2s ease;
}

.negative-prompt-header-toggle:hover {
    background-color: #444;
    border-color: #666;
}

.negative-prompt-header-toggle label {
    cursor: pointer;
    margin: 0;
    color: #ff6b6b;
    font-weight: 500;
}

.toggle-icon {
    color: #aaa;
    font-size: 12px;
    transition: transform 0.2s ease;
}

.toggle-icon.expanded {
    transform: rotate(180deg);
}

/* 네거티브 프롬프트 컨텐츠 */
.negative-prompt-content {
    overflow: hidden;
    transition: all 0.3s ease;
}

/* 네거티브 프롬프트 헬퍼 스타일 - 다크모드 */
.negative-prompt-helper {
    background-color: #2a2a2a;
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 15px;
    border: 1px solid #444;
    transition: all 0.3s ease;
}

.negative-prompt-helper:hover {
    border-color: #666;
}

/* 네거티브 프롬프트 가이드 전체 컨테이너 */
.negative-prompt-guide {
    background-color: #2c3e50;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    margin-bottom: 15px;
}

.negative-prompt-guide h5 {
    color: #ff6b6b;
    font-size: 1.1rem;
    margin: 0;
    padding: 15px 20px;
    background: #34495e;
    text-align: center;
    font-weight: 600;
}

.guide-subtitle {
    color: #bdc3c7;
    font-size: 0.9rem;
    margin: 0;
    padding: 0 20px 15px;
    background: #34495e;
    text-align: center;
    font-style: italic;
}

/* 네거티브 가이드 탭 스타일 */
.negative-guide-tabs {
    display: flex;
    background: #34495e;
    border-bottom: 1px solid #2c3e50;
    flex-wrap: wrap;
}

.negative-guide-tab {
    flex: 1;
    padding: 12px 15px;
    background: transparent;
    border: none;
    color: #bdc3c7;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 0.9em;
    font-weight: 500;
    border-right: 1px solid #2c3e50;
    min-width: 120px;
    text-align: center;
}

.negative-guide-tab:last-child {
    border-right: none;
}

.negative-guide-tab:hover {
    background: #3b536b;
    color: #ecf0f1;
}

.negative-guide-tab.active {
    background: #ff6b6b;
    color: white;
}

/* 네거티브 가이드 컨텐츠 */
.negative-guide-content {
    position: relative;
    min-height: 200px;
}

.negative-guide-panel {
    display: none;
    padding: 20px;
    color: #ecf0f1;
    background-color: #2c3e50;
}

.negative-guide-panel.active {
    display: block;
    animation: fadeIn 0.3s ease;
}

.negative-guide-panel h6 {
    color: #4CAF50;
    font-size: 1rem;
    margin-bottom: 15px;
    font-weight: 600;
}

/* 네거티브 예시들 그리드 */
.negative-examples-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 15px;
}

.negative-example-category {
    background-color: #34495e;
    border-radius: 6px;
    padding: 12px;
    border: 1px solid #4a6379;
}

.negative-example-category strong {
    color: #4CAF50;
    font-size: 0.9rem;
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    border-bottom: 1px solid #4a6379;
    padding-bottom: 4px;
}

.negative-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 8px;
}

.negative-tag {
    background-color: #444;
    color: #ddd;
    border: 1px solid #666;
    border-radius: 20px;
    padding: 6px 12px;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.2s ease;
    user-select: none;
    white-space: nowrap;
}

.negative-tag:hover {
    background-color: #555;
    border-color: #888;
    color: #fff;
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

.negative-tag:active {
    transform: translateY(0);
    box-shadow: 0 1px 2px rgba(0,0,0,0.3);
}

.negative-tag.selected {
    background-color: #ff6b6b;
    border-color: #ff5252;
    color: white;
    font-weight: 500;
    box-shadow: 0 2px 8px rgba(255, 107, 107, 0.3);
}

/* 네거티브 프롬프트 텍스트에어리어 스타일 */
#negativePrompt {
    background-color: #333;
    color: #fff;
    border: 1px solid #555;
    min-height: 60px;
    font-size: 14px;
    resize: vertical;
    transition: all 0.3s ease;
}

#negativePrompt:focus {
    border-color: #ff6b6b;
    box-shadow: 0 0 0 2px rgba(255, 107, 107, 0.2);
    background-color: #2a2a2a;
}

/* 페이드인 애니메이션 */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* 반응형 디자인 - 네거티브 프롬프트 */
@media (max-width: 768px) {
    .negative-guide-tabs {
        flex-direction: column;
    }
    
    .negative-guide-tab {
        border-right: none;
        border-bottom: 1px solid #2c3e50;
    }
    
    .negative-guide-tab:last-child {
        border-bottom: none;
    }
    
    .negative-examples-grid {
        grid-template-columns: 1fr;
        gap: 10px;
    }
    
    .negative-tags {
        gap: 4px;
    }
    
    .negative-tag {
        font-size: 0.8rem;
        padding: 5px 10px;
    }
    
    .negative-prompt-helper {
        padding: 12px;
    }
    
    .negative-guide-panel {
        padding: 15px;
    }
}

/* 에러 메시지 스타일 */
.error-container {
    background: linear-gradient(135deg, #ffebee 0%, #ffcdd2 100%);
    border: 1px solid #f44336;
    border-radius: 12px;
    padding: 20px;
    margin: 20px 0;
    box-shadow: 0 4px 12px rgba(244, 67, 54, 0.1);
}

.video-error-section {
    text-align: center;
}

.error-title {
    color: #d32f2f;
    font-size: 1.2em;
    font-weight: 600;
    margin: 0 0 15px 0;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.error-title::before {
    content: "⚠️";
    font-size: 1.2em;
}

.error-message {
    color: #b71c1c;
    font-size: 1em;
    line-height: 1.5;
    margin: 10px 0;
    padding: 12px;
    background: rgba(255, 255, 255, 0.7);
    border-radius: 8px;
    border-left: 4px solid #f44336;
}

.error-suggestion {
    color: #1976d2;
    font-size: 0.95em;
    margin-top: 15px;
    padding: 10px;
    background: rgba(33, 150, 243, 0.1);
    border-radius: 8px;
    border-left: 4px solid #6699ff;
}

.error-suggestion::before {
    content: "💡 ";
}

/* 비디오 정보 섹션의 에러 항목 스타일 */
.video-info-item.error-info {
    grid-column: span 2;
    background: rgba(244, 67, 54, 0.05);
    padding: 12px;
    border-radius: 8px;
    border-left: 4px solid #f44336;
}

.video-info-item.error-info .info-label {
    color: #d32f2f;
    font-weight: 600;
}

.video-info-item.error-info .info-value.error-message {
    color: #b71c1c;
    font-weight: 500;
    line-height: 1.4;
}

/* 상태별 스타일 */
.status-failed {
    color: #d32f2f !important;
    font-weight: 600;
    padding: 4px 8px;
    background: rgba(244, 67, 54, 0.1);
    border-radius: 4px;
}

.status-completed {
    color: #2e7d32 !important;
    font-weight: 600;
    padding: 4px 8px;
    background: rgba(76, 175, 80, 0.1);
    border-radius: 4px;
}

.status-pending {
    color: #f57c00 !important;
    font-weight: 600;
    padding: 4px 8px;
    background: rgba(255, 152, 0, 0.1);
    border-radius: 4px;
}

.status-running {
    color: #1976d2 !important;
    font-weight: 600;
    padding: 4px 8px;
    background: rgba(33, 150, 243, 0.1);
    border-radius: 4px;
}

/* 모달 스타일 */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    z-index: 1000;
    display: flex;
    justify-content: center;
    align-items: center;
    animation: fadeIn 0.3s ease;
}

.modal-content {
    background-color: #2a2a2a;
    border-radius: 12px;
    max-width: 500px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    animation: slideIn 0.3s ease;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px 16px;
    border-bottom: 1px solid #444;
}

.modal-header h3 {
    margin: 0;
    color: #ff6b6b;
    font-size: 20px;
    font-weight: 600;
}

.modal-close {
    background: none;
    border: none;
    color: #aaa;
    font-size: 28px;
    cursor: pointer;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s ease;
}

.modal-close:hover {
    background-color: rgba(255, 255, 255, 0.1);
    color: #fff;
}

.modal-body {
    padding: 24px;
    text-align: center;
}

.error-icon {
    font-size: 48px;
    margin-bottom: 16px;
    display: block;
}

.error-message-text {
    color: #fff;
    font-size: 16px;
    line-height: 1.5;
    margin-bottom: 16px;
    padding: 16px;
    background-color: rgba(255, 107, 107, 0.1);
    border: 1px solid rgba(255, 107, 107, 0.3);
    border-radius: 8px;
    text-align: left;
}

.error-suggestion-text {
    color: #aaa;
    font-size: 14px;
    line-height: 1.4;
}

.modal-footer {
    gap: 10px;
    padding: 16px 24px 24px;
    display: flex;
    justify-content: center;
}

.modal-button {
    background-color: var(--primary-color);
    color: white;
    border: none;
    padding: 12px 32px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    min-width: 100px;
}

.modal-button:hover {
    background-color: #45a049;
    transform: translateY(-1px);
}

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

@keyframes slideIn {
    from { 
        opacity: 0;
        transform: translateY(-30px) scale(0.95);
    }
    to { 
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* 저장된 비디오 액션 버튼 스타일 */
.saved-video-actions {
    margin-top: 20px;
    padding: 20px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.action-buttons-section {
    display: flex;
    gap: 12px;
    justify-content: center;
    flex-wrap: wrap;
}

/* 저장된 비디오 액션 버튼 전용 스타일 */
.saved-video-actions .action-button {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    min-width: 120px;
    justify-content: center;
}

.saved-video-actions .action-button.my-library-btn {
    background: linear-gradient(135deg, #4150F8 0%, #3a47e0 100%);
    color: white;
    box-shadow: 0 2px 8px rgba(65, 80, 248, 0.3);
}

.saved-video-actions .action-button.my-library-btn:hover {
    background: linear-gradient(135deg, #3a47e0 0%, #333fc7 100%);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(65, 80, 248, 0.4);
}

.saved-video-actions .action-button.new-video-btn {
    background: linear-gradient(135deg, #4150F8 0%, #3a47e0 100%);
    color: white;
    box-shadow: 0 2px 8px rgba(65, 80, 248, 0.3);
}

.saved-video-actions .action-button.new-video-btn:hover {
    background: linear-gradient(135deg, #3a47e0 0%, #333fc7 100%);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(65, 80, 248, 0.4);
}

.saved-video-actions .action-button:active {
    transform: translateY(0);
}

.saved-video-actions .action-button svg {
    flex-shrink: 0;
}

/* 반응형 디자인 */
@media (max-width: 768px) {
    .saved-video-actions {
        margin-top: 15px;
        padding: 15px;
    }
    
    .action-buttons-section {
        flex-direction: column;
        gap: 10px;
    }
    
    .saved-video-actions .action-button {
        width: 100%;
        padding: 14px 20px;
        font-size: 15px;
    }
    
    .modal-content {
        width: 95%;
        margin: 20px;
    }
    
    .modal-header {
        padding: 16px 20px 12px;
    }
    
    .modal-header h3 {
        font-size: 18px;
    }
    
    .modal-body {
        padding: 20px;
    }
    
    .error-icon {
        font-size: 40px;
        margin-bottom: 12px;
    }
    
    .error-message-text {
        font-size: 14px;
        padding: 12px;
    }
    
    .modal-footer {
        padding: 12px 20px 20px;
    }
    
    .error-container {
        margin: 15px 10px;
        padding: 15px;
    }
    
    .error-title {
        font-size: 1.1em;
    }
    
    .error-message {
        font-size: 0.95em;
        padding: 10px;
    }
    
    .video-info-item.error-info {
        grid-column: span 1;
        padding: 10px;
    }
}

/* 검색 기능 관련 스타일 */
.search-result-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 0;
    margin-bottom: 15px;
    border-bottom: 1px solid #333;
    background: linear-gradient(135deg, #1a1a1a 0%, #2a2a2a 100%);
    border-radius: 8px;
    padding: 15px 20px;
    margin-bottom: 20px;
}

.search-info {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #e0e0e0;
    font-size: 14px;
}

.search-keyword {
    color: #4fc3f7;
    font-weight: 600;
    background: rgba(79, 195, 247, 0.1);
    padding: 2px 8px;
    border-radius: 4px;
    border: 1px solid rgba(79, 195, 247, 0.3);
}

.search-count {
    color: #81c784;
    font-weight: 600;
    background: rgba(129, 199, 132, 0.1);
    padding: 2px 8px;
    border-radius: 4px;
    border: 1px solid rgba(129, 199, 132, 0.3);
}

.clear-search-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #e0e0e0;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.clear-search-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.3);
    transform: translateY(-1px);
}

.clear-search-btn svg {
    width: 14px;
    height: 14px;
}

/* 검색 결과 없음 메시지 */
.no-search-results {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    text-align: center;
    color: #888;
    background: rgba(255, 255, 255, 0.02);
    border-radius: 12px;
    border: 1px dashed rgba(255, 255, 255, 0.1);
    margin: 20px 0;
}

.no-results-icon {
    font-size: 48px;
    margin-bottom: 16px;
    opacity: 0.6;
}

.no-results-text {
    font-size: 18px;
    font-weight: 500;
    color: #aaa;
    margin-bottom: 8px;
}

.no-results-suggestion {
    font-size: 14px;
    color: #666;
}

/* 검색 에러 메시지 */
.search-error {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    text-align: center;
    color: #ff6b6b;
    background: rgba(255, 107, 107, 0.05);
    border-radius: 12px;
    border: 1px solid rgba(255, 107, 107, 0.2);
    margin: 20px 0;
}

.error-icon {
    font-size: 48px;
    margin-bottom: 16px;
    opacity: 0.8;
}

.error-message {
    font-size: 16px;
    font-weight: 500;
    margin-bottom: 20px;
    color: #ff8a80;
}

.retry-search-btn {
    background: linear-gradient(135deg, #ff6b6b 0%, #ff8a80 100%);
    border: none;
    color: white;
    padding: 10px 20px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.retry-search-btn:hover {
    background: linear-gradient(135deg, #ff5252 0%, #ff6b6b 100%);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(255, 107, 107, 0.3);
}

/* 검색 입력 필드 개선 */
.search-input {
    transition: all 0.3s ease;
    position: relative;
}

.search-input:focus {
    border-color: #4fc3f7;
    box-shadow: 0 0 0 2px rgba(79, 195, 247, 0.2);
    outline: none;
}

/* 검색 중 로딩 스타일 개선 */
.loading {
    position: relative;
    color: #4fc3f7;
    font-weight: 500;
}

.loading::after {
    content: '';
    position: absolute;
    right: -20px;
    top: 50%;
    transform: translateY(-50%);
    width: 12px;
    height: 12px;
    border: 2px solid #4fc3f7;
    border-top: 2px solid transparent;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: translateY(-50%) rotate(0deg); }
    100% { transform: translateY(-50%) rotate(360deg); }
}

/* 검색 결과 하이라이트 효과 */
.stock-item.search-result {
    border: 1px solid rgba(79, 195, 247, 0.3);
    background: rgba(79, 195, 247, 0.05);
}

.stock-item.search-result:hover {
    border-color: rgba(79, 195, 247, 0.5);
    background: rgba(79, 195, 247, 0.1);
}

/* 검색 모드 표시 */
.search-mode-indicator {
    position: absolute;
    top: -8px;
    left: 50%;
    transform: translateX(-50%);
    background: #4fc3f7;
    color: white;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 10px;
    font-weight: 500;
    opacity: 0.8;
}

/* 반응형 디자인 */
@media (max-width: 768px) {
    .search-result-header {
        flex-direction: column;
        gap: 12px;
        align-items: flex-start;
    }
    
    .search-info {
        flex-wrap: wrap;
    }
    
    .clear-search-btn {
        align-self: flex-end;
    }
}

/* 사용자 정보 패널 스타일 */
.user-info-panel {
    display: flex;
    align-items: center;
    gap: 12px;
}

/* 사용자 등급 배지 */
.user-grade-badge {
    display: flex;
    align-items: center;
    gap: 6px;
    background: linear-gradient(135deg, var(--primary-color), #6366f1);
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(65, 80, 248, 0.3);
}

.user-grade-badge:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(65, 80, 248, 0.4);
}

.user-grade-badge.basic {
    background: linear-gradient(135deg, #10b981, #059669);
    box-shadow: 0 2px 8px rgba(16, 185, 129, 0.3);
}

.user-grade-badge.basic:hover {
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.4);
}

.user-grade-badge.regular {
    background: linear-gradient(135deg, #6b7280, #4b5563);
    box-shadow: 0 2px 8px rgba(107, 114, 128, 0.3);
}

.user-grade-badge.regular:hover {
    box-shadow: 0 4px 12px rgba(107, 114, 128, 0.4);
}

.user-grade-badge.premium {
    background: linear-gradient(135deg, #f59e0b, #d97706);
    box-shadow: 0 2px 8px rgba(245, 158, 11, 0.3);
}

.user-grade-badge.premium:hover {
    box-shadow: 0 4px 12px rgba(245, 158, 11, 0.4);
}

.grade-icon {
    font-size: 14px;
}

.grade-text {
    font-size: 11px;
    letter-spacing: 0.3px;
}

/* 크레딧 정보 컨테이너 */
.credit-info-container {
    display: flex;
    gap: 16px;
}

/* 크레딧 아이템 */
.credit-item {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 1px solid transparent;
}

.credit-item:hover {
    transform: translateY(-1px);
    border-color: rgba(255, 255, 255, 0.2);
}

/* 마일리지 (무료 크레딧) */
.credit-item.mileage {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.2), rgba(5, 150, 105, 0.2));
    border-color: rgba(16, 185, 129, 0.3);
}

.credit-item.mileage:hover {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.3), rgba(5, 150, 105, 0.3));
    border-color: rgba(16, 185, 129, 0.5);
}

/* 캐시 (유료 크레딧) */
.credit-item.cash {
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.2), rgba(217, 119, 6, 0.2));
    border-color: rgba(245, 158, 11, 0.3);
}

.credit-item.cash:hover {
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.3), rgba(217, 119, 6, 0.3));
    border-color: rgba(245, 158, 11, 0.5);
}

.credit-icon {
    font-size: 14px;
}

.credit-label {
    font-size: 10px;
    opacity: 0.8;
    font-weight: 500;
}

.credit-amount {
    font-weight: 700;
    font-size: 11px;
}

/* 새로고침 버튼 */
.refresh-user-info-btn {
    background: none;
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: rgba(255, 255, 255, 0.7);
    padding: 6px;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.refresh-user-info-btn:hover {
    background-color: rgba(255, 255, 255, 0.1);
    color: white;
    border-color: rgba(255, 255, 255, 0.3);
    transform: rotate(90deg);
}

.refresh-user-info-btn:active {
    transform: scale(0.95) rotate(90deg);
}

/* 로그인 프롬프트 */
.login-prompt {
    display: flex;
    align-items: center;
}

.login-button {
    display: flex;
    align-items: center;
    gap: 6px;
    background: linear-gradient(135deg, var(--primary-color), #6366f1);
    border: none;
    color: white;
    padding: 8px 16px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(65, 80, 248, 0.3);
}

.login-button:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(65, 80, 248, 0.4);
}

.login-button:active {
    transform: scale(0.98);
}

.login-icon {
    font-size: 14px;
}

/* 툴팁 스타일 */
.tooltip {
    position: absolute;
    background: linear-gradient(135deg, #1f2937, #111827);
    color: white;
    padding: 12px 16px;
    border-radius: 8px;
    font-size: 12px;
    line-height: 1.4;
    max-width: 280px;
    z-index: 1000;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    pointer-events: none;
    opacity: 0;
    transform: translateY(5px);
    transition: all 0.3s ease;
}

.tooltip.show {
    opacity: 1;
    transform: translateY(0);
}

.tooltip::before {
    content: '';
    position: absolute;
    top: -6px;
    left: 50%;
    transform: translateX(-50%);
    border-left: 6px solid transparent;
    border-right: 6px solid transparent;
    border-bottom: 6px solid #1f2937;
}

.tooltip .tooltip-title {
    font-weight: 700;
    font-size: 13px;
    margin-bottom: 6px;
    color: var(--primary-color);
}

.tooltip .tooltip-description {
    font-size: 11px;
    line-height: 1.5;
    opacity: 0.9;
}

.tooltip .tooltip-feature {
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    font-size: 10px;
    opacity: 0.8;
}

/* 기존 크레딧 스타일 제거 및 대체 */
.credit-balance-display {
    display: none; /* 기존 스타일 비활성화 */
}

/* 로그인 모달 스타일 */
#loginRequiredModal {
    z-index: 1001;
}

#loginRequiredModal .modal-content {
    max-width: 480px;
    animation: slideInScale 0.3s ease-out;
}

.login-modal-icon {
    text-align: center;
    font-size: 48px;
    margin-bottom: 20px;
    opacity: 0.8;
}

.login-modal-message {
    text-align: center;
    font-size: 16px;
    color: #e0e0e0;
    margin-bottom: 30px;
    line-height: 1.6;
}

.login-modal-benefits {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 20px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.login-modal-benefits h4 {
    font-size: 16px;
    color: #4fc3f7;
    margin: 0 0 16px 0;
    font-weight: 600;
    text-align: center;
}

.login-modal-benefits ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.login-modal-benefits li {
    padding: 8px 0;
    color: #e0e0e0;
    font-size: 14px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.login-modal-benefits li:last-child {
    border-bottom: none;
}

.modal-button.primary {
    background: linear-gradient(135deg, #4fc3f7 0%, #5a6aff 100%);
    color: white;
    border: none;
    font-weight: 600;
}

.modal-button.primary:hover {
    background: linear-gradient(135deg, #29b6f6 0%, #4150f8 100%);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(79, 195, 247, 0.3);
}

.modal-button.secondary {
    background: rgba(255, 255, 255, 0.1);
    color: #e0e0e0;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.modal-button.secondary:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.3);
}

@keyframes slideInScale {
    0% {
        opacity: 0;
        transform: translateY(-20px) scale(0.95);
    }
    100% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* 로그인 모달 반응형 */
@media (max-width: 768px) {
    #loginRequiredModal .modal-content {
        max-width: 90%;
        margin: 10% auto;
    }
    
    .login-modal-icon {
        font-size: 40px;
        margin-bottom: 16px;
    }
    
    .login-modal-message {
        font-size: 14px;
        margin-bottom: 24px;
    }
    
    .login-modal-benefits {
        padding: 16px;
        margin-bottom: 16px;
    }
    
    .login-modal-benefits h4 {
        font-size: 14px;
        margin-bottom: 12px;
    }
    
    .login-modal-benefits li {
        font-size: 13px;
        padding: 6px 0;
    }
}

/* 크레딧 부족 모달 스타일 */
#creditInsufficientModal {
    z-index: 1001;
    animation: fadeIn 0.3s ease-out;
}

#creditInsufficientModal .modal-content {
    max-width: 500px;
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    animation: slideInScale 0.3s ease-out;
}

.credit-modal-icon {
    text-align: center;
    font-size: 64px;
    margin-bottom: 20px;
    animation: pulse 2s infinite;
}

.credit-modal-message {
    text-align: center;
    font-size: 16px;
    color: #e0e0e0;
    margin-bottom: 24px;
    line-height: 1.6;
}

.credit-modal-benefits {
    background: rgba(255, 255, 255, 0.03);
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 20px;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.credit-modal-benefits h4 {
    font-size: 16px;
    font-weight: 600;
    color: #fff;
    margin: 0 0 16px 0;
    text-align: center;
}

.credit-modal-benefits ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.credit-modal-benefits li {
    padding: 8px 0;
    color: #b0b0b0;
    font-size: 14px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.credit-modal-benefits li:last-child {
    border-bottom: none;
}

.credit-modal-balance {
    background: rgba(255, 107, 107, 0.1);
    border: 1px solid rgba(255, 107, 107, 0.2);
    border-radius: 8px;
    padding: 12px 16px;
    margin-bottom: 16px;
    text-align: center;
}

.credit-modal-balance .balance-title {
    font-size: 12px;
    color: #ff8a80;
    margin-bottom: 4px;
    font-weight: 500;
}

.credit-modal-balance .balance-info {
    font-size: 14px;
    color: #ffcdd2;
    line-height: 1.4;
}

.credit-modal-balance .required-amount {
    font-weight: 600;
    color: #ff6b6b;
}

#creditModalChargeBtn {
    background: linear-gradient(135deg, #ff6b6b 0%, #ff8a80 100%);
    border: none;
    color: white;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    transition: all 0.3s ease;
}

#creditModalChargeBtn:hover {
    background: linear-gradient(135deg, #ff5252 0%, #ff6b6b 100%);
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(255, 107, 107, 0.4);
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

@media (max-width: 768px) {
    #creditInsufficientModal .modal-content {
        max-width: 90%;
        margin: 10% auto;
    }
    
    .credit-modal-icon {
        font-size: 48px;
        margin-bottom: 16px;
    }
    
    .credit-modal-message {
        font-size: 14px;
        margin-bottom: 20px;
    }
    
    .credit-modal-benefits {
        padding: 16px;
        margin-bottom: 16px;
    }
    
    .credit-modal-benefits h4 {
        font-size: 14px;
        margin-bottom: 12px;
    }
    
    .credit-modal-benefits li {
        font-size: 12px;
        padding: 6px 0;
    }
}

/* 크레딧 부족 모달이 표시될 때 스크롤 방지 */
body.modal-open {
    overflow: hidden !important;
}

body.modal-open .main-content {
    overflow: hidden !important;
}

/* 다운로드 진행 상태 오버레이 */
.download-progress-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10000;
    backdrop-filter: blur(5px);
}

.download-progress-content {
    background: var(--card-bg);
    border-radius: 16px;
    padding: 40px;
    text-align: center;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    max-width: 400px;
    width: 90%;
    border: 1px solid var(--border-color);
}

.download-spinner {
    width: 60px;
    height: 60px;
    border: 4px solid var(--border-color);
    border-top: 4px solid var(--primary-color);
    border-radius: 50%;
    animation: downloadSpin 1s linear infinite;
    margin: 0 auto 20px;
}

@keyframes downloadSpin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.download-message {
    color: var(--text-primary);
    font-size: 18px;
    font-weight: 600;
    margin: 0 0 10px 0;
}

.download-sub-message {
    color: var(--text-secondary);
    font-size: 14px;
    margin: 0;
    line-height: 1.4;
}

/* 워터마크 정책 안내 스타일 */
.watermark-policy-notice {
    background: linear-gradient(135deg, #ffeaa7, #fdcb6e);
    border: 1px solid #e17055;
    border-radius: 8px;
    padding: 12px 16px;
    margin: 16px 0;
    color: #2d3436;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.watermark-policy-notice .icon {
    font-size: 18px;
    color: #e17055;
}

.watermark-policy-notice .text {
    flex: 1;
    line-height: 1.4;
}

/* 프리미엄 유저 안내 */
.premium-notice {
    background: linear-gradient(135deg, #74b9ff, #0984e3);
    border: 1px solid #0984e3;
    color: white;
}

.premium-notice .icon {
    color: #ffeaa7;
}

/* 다크 모드 지원 */
@media (prefers-color-scheme: dark) {
    .download-progress-content {
        background: var(--card-bg-dark, #2c2c2c);
        border-color: var(--border-color-dark, #404040);
    }
    
    .download-message {
        color: var(--text-primary-dark, #ffffff);
    }
    
    .download-sub-message {
        color: var(--text-secondary-dark, #cccccc);
    }
}

/* 반응형 디자인 */
@media (max-width: 768px) {
    .download-progress-content {
        padding: 30px 20px;
        margin: 20px;
    }
    
    .download-spinner {
        width: 50px;
        height: 50px;
        border-width: 3px;
    }
    
    .download-message {
        font-size: 16px;
    }
    
    .download-sub-message {
        font-size: 13px;
    }
}

/* 객관식 프롬프트 빌더 스타일 */
.prompt-builder {
    background: #2a2a2a;
    border-radius: 12px;
    padding: 20px;
    border: 1px solid #444;
    margin-bottom: 15px;
}

.prompt-section {
    margin-bottom: 25px;
    padding-bottom: 20px;
    border-bottom: 1px solid #444;
}

.prompt-section:last-child {
    margin-bottom: 0;
    border-bottom: none;
    padding-bottom: 0;
}

.section-title {
    color: #4150F8;
    font-size: 16px;
    font-weight: 600;
    margin: 0 0 15px 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.section-title::before {
    content: "▶";
    font-size: 12px;
    color: #4150F8;
}

.option-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 15px;
}

.option-btn {
    background: #333;
    color: #ddd;
    border: 1px solid #555;
    border-radius: 20px;
    padding: 8px 16px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.option-btn:hover {
    background: #444;
    border-color: #666;
    transform: translateY(-1px);
}

.option-btn.active {
    background: #4150F8;
    color: white;
    border-color: #4150F8;
    box-shadow: 0 2px 8px rgba(65, 80, 248, 0.3);
}

.option-btn.active:hover {
    background: #3140b8;
    border-color: #3140b8;
}

/* 서브 옵션 */
.sub-options {
    margin-left: 20px;
    padding: 15px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    border-left: 3px solid #4150F8;
    margin-top: 10px;
    transition: all 0.3s ease;
}

.sub-option-group {
    margin-bottom: 15px;
}

.sub-option-group:last-child {
    margin-bottom: 0;
}

.sub-option-group label {
    display: block;
    color: #bbb;
    font-size: 13px;
    font-weight: 500;
    margin-bottom: 8px;
}

.custom-input {
    width: 100%;
    background: #1a1a1a;
    border: 1px solid #555;
    border-radius: 6px;
    color: #ddd;
    font-size: 13px;
    padding: 8px 12px;
    transition: all 0.2s ease;
}

.custom-input:focus {
    outline: none;
    border-color: #4CAF50;
    box-shadow: 0 0 0 2px rgba(76, 175, 80, 0.2);
}

.custom-input::placeholder {
    color: #888;
}

/* 직접 입력 버튼 스타일 */
.custom-input-btn {
    background: #333;
    color: #ddd;
    border: 1px solid #555;
    font-weight: 500;
}

.custom-input-btn:hover {
    background: #444;
    border-color: #666;
    transform: translateY(-1px);
}

.custom-input-btn.active {
    background: #4150F8;
    color: white;
    border-color: #4150F8;
    box-shadow: 0 2px 8px rgba(65, 80, 248, 0.3);
}

.custom-input-btn.active:hover {
    background: #3140b8;
    border-color: #3140b8;
}

/* 직접 입력 그룹 스타일 */
.custom-input-group {
    margin-top: 15px;
    padding: 15px;
    background: rgba(65, 80, 248, 0.1);
    border-radius: 8px;
    border: 1px solid rgba(65, 80, 248, 0.3);
    animation: fadeIn 0.3s ease;
}

.custom-input-group .custom-input {
    background: #1a1a1a;
    border: 1px solid #555;
    color: #ddd;
    font-size: 13px;
    padding: 10px 12px;
    border-radius: 6px;
    width: 100%;
    transition: all 0.2s ease;
}

.custom-input-group .custom-input:focus {
    outline: none;
    border-color: #4150F8;
    box-shadow: 0 0 0 2px rgba(65, 80, 248, 0.2);
    background: #2a2a2a;
}

/* 액션 카테고리 */
.action-categories {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.action-category h5 {
    color: #6699ff;
    font-size: 14px;
    font-weight: 600;
    margin: 0 0 10px 0;
    padding-bottom: 5px;
    border-bottom: 1px solid #6699ff;
}

/* 프롬프트 미리보기 */
.prompt-preview {
    background: rgba(76, 175, 80, 0.1);
    border-radius: 8px;
    padding: 15px;
    border: 1px solid rgba(76, 175, 80, 0.3);
}

.generated-prompt-text {
    background: #1a1a1a;
    border: 1px solid #555;
    border-radius: 6px;
    padding: 12px;
    color: #ddd;
    font-size: 14px;
    line-height: 1.5;
    min-height: 60px;
    max-height: 120px;
    overflow-y: auto;
    white-space: pre-wrap;
    word-wrap: break-word;
}

.generated-prompt-text.empty {
    color: #888;
    font-style: italic;
}

/* 반응형 디자인 */
@media (max-width: 768px) {
    .action-categories {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .option-buttons {
        gap: 6px;
    }
    
    .option-btn {
        font-size: 12px;
        padding: 6px 12px;
    }
    
    .sub-options {
        margin-left: 10px;
        padding: 10px;
    }
    
    .prompt-builder {
        padding: 15px;
    }
}

/* 반응형 디자인 */
@media (max-width: 768px) {
    .prompt-builder {
        padding: 15px;
    }
}

/* 모바일 PC 버전 안내 배너 */
.mobile-pc-notice {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: white;
    color: #333;
    text-align: center;
    z-index: 999;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    animation: slideDown 0.5s ease;
    border-bottom: 1px solid #e0e0e0;
}

.mobile-pc-notice.show {
    display: block;
}

.mobile-pc-notice .notice-content {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    max-width: 600px;
    margin: 0 auto;
}

.mobile-pc-notice .notice-text {
    font-size: 0.8rem;
    font-weight: 500;
    line-height: 1.3;
    white-space: nowrap;
}

.mobile-pc-notice .close-btn {
    background: none;
    border: none;
    color: #666;
    font-size: 1.2rem;
    cursor: pointer;
    padding: 5px;
    margin-left: 10px;
    opacity: 0.8;
    transition: opacity 0.2s ease;
    flex-shrink: 0;
}

.mobile-pc-notice .close-btn:hover {
    opacity: 1;
    color: #333;
}

@keyframes slideDown {
    from {
        transform: translateY(-100%);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* 모바일에서 GNB 위치 조정 */
.gnb.mobile-notice-active {
    top: 60px;
}

/* 라이선스 동의 모달 스타일 */
.license-modal .license-content {
    max-width: 500px;
    width: 90%;
}

.license-text {
    text-align: center;
    line-height: 1.6;
    margin-bottom: 20px;
}

.license-text p {
    color: #ddd;
    margin-bottom: 20px;
    font-size: 14px;
}

.license-text strong {
    color: #fff;
    font-weight: 600;
}

.license-agreement {
    margin-top: 25px;
    padding: 15px;
    background: rgba(76, 175, 80, 0.1);
    border: 1px solid rgba(76, 175, 80, 0.3);
    border-radius: 8px;
}

.checkbox-label {
    display: flex;
    align-items: center;
    cursor: pointer;
    color: #ddd;
    font-size: 14px;
    font-weight: 500;
    gap: 10px;
}

.checkbox-label input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: #4CAF50;
    cursor: pointer;
}

.checkbox-label:hover {
    color: #fff;
}

.modal-btn {
    padding: 12px 24px;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    margin: 0 5px;
}

.modal-btn-primary {
    background: #4CAF50;
    color: white;
}

.modal-btn-primary:enabled:hover {
    background: #45a049;
    transform: translateY(-1px);
}

.modal-btn-primary:disabled {
    background: #666;
    color: #999;
    cursor: not-allowed;
    transform: none;
}

.modal-btn-secondary {
    background: #666;
    color: #ddd;
}

.modal-btn-secondary:hover {
    background: #777;
    color: #fff;
    transform: translateY(-1px);
}

/* 워터마크 오버레이 스타일 */
.video-container-with-watermark {
    position: relative;
    display: inline-block;
    width: fit-content;
    height: fit-content;
}

.video-container-with-watermark video {
    position: relative;
    z-index: 1;
    display: block;
}

.watermark-overlay {
    position: absolute;
    bottom: 10px;
    right: 10px;
    width: 50%;
    height: auto;
    opacity: 0.4;
    pointer-events: none;
    z-index: 10;
    transition: opacity 0.3s ease;
}

.watermark-overlay img {
    width: 100%;
    height: auto;
    display: block;
}

/* 반응형 워터마크 크기 조정 */
@media (max-width: 768px) {
    .watermark-overlay {
        width: 20%;
        bottom: 8px;
        right: 8px;
    }
}

@media (max-width: 480px) {
    .watermark-overlay {
        width: 25%;
        bottom: 6px;
        right: 6px;
    }
}

/* 다크 모드 지원 */
@media (prefers-color-scheme: dark) {
    .watermark-overlay {
        filter: brightness(1.2);
    }
}