/* Storyboard Specific Styles */

/* Page Header with Metadata Container */
.page-header-with-metadata {
    display: flex;
    gap: 20px;
    align-items: flex-start;
    margin-bottom: 20px;
    justify-content: space-between;
}

.page-header-with-metadata .page-header {
    flex: 0 0 auto;
    min-width: 300px;
}

/* Film Metadata Header */
.film-metadata {
    flex: 0 0 auto;
    max-width: 500px;
    padding: 12px 20px;
    background: rgba(255, 255, 255, 0.02);
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    margin-left: auto;
}

.metadata-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 15px;
}

.metadata-main {
    flex: 1;
}

.film-title {
    font-size: 18px;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.95);
    margin-bottom: 6px;
}

.film-info {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
}

.info-item {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 14px;
    color: var(--muted-foreground);
}

.info-item svg {
    color: rgba(255, 255, 255, 0.6);
}

.metadata-actions {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 200px;
}

.progress-bar {
    flex: 1;
    height: 8px;
    background: var(--secondary);
    border-radius: 4px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: rgba(255, 255, 255, 0.3);
    transition: width 0.3s ease;
}

.progress-text {
    font-size: 14px;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.6);
    min-width: 40px;
    text-align: right;
}

/* Button Styles */
.btn-secondary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 16px;
    background: var(--secondary);
    color: var(--foreground);
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.btn-secondary:hover {
    background: var(--accent);
    border-color: var(--muted-foreground);
    transform: translateY(-1px);
}

/* File Upload Area */
.upload-section {
    width: 50%;
    padding: 20px;
    margin: 50px auto 30px auto;
    background: rgba(255, 255, 255, 0.02);
    border-radius: 12px;
    border: 2px dashed rgba(255, 255, 255, 0.2);
    transition: all 0.3s ease;
}

.upload-area {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 200px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.upload-area.drag-over {
    border-color: rgba(255, 255, 255, 0.4);
    background: rgba(255, 255, 255, 0.05);
}

.upload-icon {
    width: 60px;
    height: 60px;
    margin-bottom: 16px;
    color: rgba(255, 255, 255, 0.6);
}

.upload-text {
    font-size: 18px;
    font-weight: 600;
    color: var(--foreground);
    margin-bottom: 8px;
}

.upload-hint {
    font-size: 14px;
    color: var(--muted-foreground);
}

.file-input {
    display: none;
}

/* Navigation Controls */
.storyboard-controls {
    display: flex;
    gap: 5px;
    align-items: center;
    padding: 20px;
    background: var(--card);
    border-radius: 12px;
    margin-bottom: 10px;
    flex-wrap: wrap;
}

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

.control-label {
    font-size: 14px;
    font-weight: 500;
    color: var(--muted-foreground);
}

.dropdown-select {
    min-width: 180px;
    padding: 10px 12px;
    background: var(--background);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--foreground);
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.dropdown-select:hover {
    border-color: rgba(255, 255, 255, 0.3);
}

.dropdown-select:focus {
    outline: none;
    border-color: rgba(255, 255, 255, 0.4);
    box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.05);
}

/* Storyboard Grid */
.storyboard-container {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 24px;
    padding: 20px;
}

/* Storyboard Card */
.storyboard-card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 12px;
    overflow: hidden;
    transition: all 0.3s ease;
    cursor: pointer;
}

.storyboard-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.2);
    border-color: rgba(255, 255, 255, 0.2);
}

.card-header {
    padding: 12px 16px;
    background: rgba(255, 255, 255, 0.03);
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.shot-id {
    font-size: 13px;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.7);
}

.shot-type {
    font-size: 11px;
    padding: 4px 8px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
    color: rgba(255, 255, 255, 0.6);
    text-transform: uppercase;
}

.scene-type {
    font-size: 11px;
    padding: 4px 8px;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 4px;
    color: rgba(255, 255, 255, 0.8);
    font-weight: 600;
    text-transform: uppercase;
}

.card-thumbnail {
    width: 100%;
    height: 160px;
    background: rgba(0, 0, 0, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

.thumbnail-placeholder {
    color: var(--muted-foreground);
    font-size: 40px;
    opacity: 0.3;
}

.card-content {
    padding: 16px;
}

.shot-text {
    font-size: 13px;
    line-height: 1.5;
    color: var(--foreground);
    margin-bottom: 12px;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.concept-art-refs {
    font-size: 12px;
    line-height: 1.4;
    color: rgba(255, 255, 255, 0.7);
    background: rgba(255, 255, 255, 0.05);
    padding: 8px;
    border-radius: 6px;
    margin-top: 8px;
    white-space: pre-line;
    font-family: 'SF Mono', 'Monaco', 'Courier New', monospace;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.card-meta {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.meta-item {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: var(--muted-foreground);
}

.meta-icon {
    width: 14px;
    height: 14px;
}

.meta-label {
    font-weight: 500;
}

.meta-value {
    color: var(--foreground);
}

.card-footer {
    padding: 8px;
    border-top: 1px solid var(--border);
    display: flex;
    align-items: center;
    gap: 4px;
}

.card-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    width: 100%;
}

.card-tag {
    padding: 4px 8px;
    background: var(--secondary);
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: 11px;
    font-weight: 500;
    color: var(--muted-foreground);
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.card-tag:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.3);
    color: rgba(255, 255, 255, 0.9);
}

.card-tag.video-tag {
    background: rgba(255, 107, 107, 0.1);
    border-color: rgba(255, 107, 107, 0.2);
    color: #ff6b6b;
    font-weight: 600;
}

.card-tag.video-tag:hover {
    background: rgba(255, 107, 107, 0.2);
    border-color: rgba(255, 107, 107, 0.4);
}

/* Delete tag special style */
.card-tag:nth-child(4) {
    background: rgba(239, 68, 68, 0.08);
    border-color: rgba(239, 68, 68, 0.2);
    color: #ef4444;
}

.card-tag:nth-child(4):hover {
    background: rgba(239, 68, 68, 0.2);
    border-color: rgba(239, 68, 68, 0.4);
    color: #fff;
    font-weight: 600;
}

/* 삭제 중 카드 애니메이션 */
.storyboard-card.deleting {
    animation: fadeOut 0.3s ease forwards;
    pointer-events: none;
}

@keyframes fadeOut {
    0% {
        opacity: 1;
        transform: scale(1);
    }
    100% {
        opacity: 0;
        transform: scale(0.95);
    }
}

/* Scene Section */
.scene-section {
    margin-bottom: 60px;
}

.scene-header {
    padding: 20px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 12px;
    margin-bottom: 24px;
}

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

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

.scene-description-wrapper {
    position: relative;
}

.scene-description {
    font-size: 14px;
    color: var(--muted-foreground);
    line-height: 1.6;
    white-space: pre-wrap;
    word-wrap: break-word;
    max-width: 100%;
    transition: all 0.3s ease;
}

.scene-description.collapsed {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.scene-description.expanded {
    white-space: pre-wrap;
    animation: expandDescription 0.3s ease;
}

@keyframes expandDescription {
    from { opacity: 0.7; }
    to { opacity: 1; }
}

.description-toggle-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-top: 8px;
    padding: 6px 12px;
    background: linear-gradient(135deg, rgba(249, 139, 88, 0.1) 0%, rgba(249, 139, 88, 0.05) 100%);
    border: 1px solid rgba(249, 139, 88, 0.2);
    border-radius: 6px;
    color: #f98b58;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.description-toggle-btn:hover {
    background: linear-gradient(135deg, rgba(249, 139, 88, 0.15) 0%, rgba(249, 139, 88, 0.08) 100%);
    border-color: rgba(249, 139, 88, 0.3);
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(249, 139, 88, 0.15);
}

.description-toggle-btn .toggle-text {
    font-size: 13px;
}

.description-toggle-btn .toggle-icon {
    transition: transform 0.3s ease;
}

/* Empty State */
.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 400px;
    text-align: center;
    padding: 40px;
}

.empty-icon {
    width: 80px;
    height: 80px;
    color: var(--muted-foreground);
    margin-bottom: 20px;
    opacity: 0.5;
}

.empty-title {
    font-size: 20px;
    font-weight: 600;
    color: var(--foreground);
    margin-bottom: 8px;
}

.empty-description {
    font-size: 14px;
    color: var(--muted-foreground);
    max-width: 400px;
}

/* Loading State */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    display: none;
}

.loading-overlay.active {
    display: flex;
}

.loading-spinner {
    width: 50px;
    height: 50px;
    border: 3px solid var(--border);
    border-top-color: rgba(255, 255, 255, 0.6);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* Responsive Design */
@media (max-width: 1280px) {
    .storyboard-container {
        grid-template-columns: repeat(3, 1fr);
    }

    .page-header-with-metadata {
        flex-direction: column;
        gap: 15px;
    }

    .page-header-with-metadata .page-header {
        width: 100%;
    }

    .film-metadata {
        max-width: 100%;
        margin-left: 0;
    }
}

@media (max-width: 1024px) {
    .storyboard-container {
        grid-template-columns: repeat(2, 1fr);
    }

    .upload-section {
        width: 70%;
    }
}

@media (max-width: 768px) {
    .storyboard-controls {
        flex-direction: column;
        align-items: stretch;
    }

    .control-group {
        width: 100%;
    }

    .dropdown-select {
        width: 100%;
    }

    .upload-section {
        width: 90%;
    }
}

@media (max-width: 640px) {
    .storyboard-container {
        grid-template-columns: 1fr;
        padding: 12px;
    }

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

    .card-thumbnail {
        height: 140px;
    }

    .card-tag {
        font-size: 10px;
        padding: 3px 6px;
    }

    .card-footer {
        padding: 6px;
    }
}

/* Shot Detail Modal Container */
.shot-detail-modal-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.9);
    z-index: 10000;
    display: flex;
    justify-content: center;
    align-items: center;
    animation: fadeIn 0.3s ease;
}

.shot-detail-modal-wrapper {
    width: 95%;
    height: 95%;
    max-width: 1600px;
    max-height: 1000px;
    background-color: #1a1a1a;
    border-radius: 12px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

/* Scenario Modal Styles */
.scenario-container {
    padding: 30px;
}

.scenario-header {
    margin-bottom: 25px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding-bottom: 20px;
}

.scenario-header h2 {
    color: rgba(255, 255, 255, 0.95);
    font-size: 24px;
    margin-bottom: 8px;
}

.scenario-header p {
    color: rgba(255, 255, 255, 0.6);
    font-size: 14px;
}

/* Scenario Tabs */
.scenario-tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 25px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.tab-btn {
    padding: 10px 20px;
    background: none;
    border: none;
    border-bottom: 2px solid transparent;
    color: rgba(255, 255, 255, 0.6);
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 14px;
    font-weight: 500;
}

.tab-btn:hover {
    color: rgba(255, 255, 255, 0.9);
}

.tab-btn.active {
    color: var(--primary);
    border-bottom-color: var(--primary);
}

/* Scenario Content */
.scenario-content {
    max-height: 500px;
    overflow-y: auto;
    padding: 20px;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 8px;
    margin-bottom: 25px;
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

.scenario-section {
    margin-bottom: 25px;
}

.scenario-section h3 {
    color: var(--primary);
    font-size: 16px;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid rgba(255, 107, 107, 0.2);
}

.scenario-subsection {
    margin-bottom: 20px;
    padding-left: 20px;
}

.scenario-subsection h4 {
    color: rgba(255, 255, 255, 0.8);
    font-size: 14px;
    margin-bottom: 8px;
}

.scenario-text {
    color: rgba(255, 255, 255, 0.9);
    line-height: 1.6;
    font-size: 14px;
    padding: 10px;
    background: rgba(255, 255, 255, 0.02);
    border-radius: 6px;
    white-space: pre-wrap;
}

/* Treatment Content */
.treatment-sequence {
    margin-bottom: 25px;
    padding: 15px;
    background: rgba(255, 255, 255, 0.02);
    border-radius: 8px;
    border-left: 3px solid var(--primary);
}

.treatment-sequence h4 {
    color: var(--primary);
    font-size: 15px;
    margin-bottom: 8px;
}

.treatment-sequence .sequence-function {
    color: rgba(255, 255, 255, 0.5);
    font-size: 12px;
    text-transform: uppercase;
    margin-bottom: 10px;
}

/* Scene Content */
.scene-item {
    margin-bottom: 30px;
    padding: 20px;
    background: rgba(255, 255, 255, 0.02);
    border-radius: 8px;
}

.scene-item h4 {
    color: rgba(255, 255, 255, 0.95);
    font-size: 16px;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.scene-number {
    background: var(--primary);
    color: white;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 600;
}

/* Shot Content */
.shot-item {
    margin-bottom: 25px;
    padding: 15px;
    background: rgba(255, 255, 255, 0.02);
    border-radius: 8px;
}

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

.shot-id {
    color: var(--primary);
    font-weight: 600;
    font-size: 14px;
}

.shot-meta {
    display: flex;
    gap: 10px;
}

.shot-type,
.camera-type {
    font-size: 11px;
    padding: 2px 6px;
    background: rgba(255, 107, 107, 0.2);
    color: var(--primary);
    border-radius: 3px;
}

.shot-text {
    color: rgba(255, 255, 255, 0.85);
    line-height: 1.5;
    font-size: 13px;
}

.shot-movement {
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    font-size: 12px;
    color: rgba(255, 255, 255, 0.6);
}

/* Scenario Actions */
.scenario-actions {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
    padding-top: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.scenario-actions .btn-secondary,
.scenario-actions .btn-primary {
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Scrollbar Styling */
.scenario-content::-webkit-scrollbar {
    width: 8px;
}

.scenario-content::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.02);
    border-radius: 4px;
}

.scenario-content::-webkit-scrollbar-thumb {
    background: rgba(255, 107, 107, 0.3);
    border-radius: 4px;
}

.scenario-content::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 107, 107, 0.5);
}

/* Merge Options Styles */
.merge-options {
    margin-top: 20px;
    padding: 20px;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
}

.merge-title {
    font-size: 16px;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.9);
    margin-bottom: 15px;
}

.merge-mode-selector {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 20px;
}

.merge-option {
    display: flex;
    flex-direction: column;
    padding: 12px;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.merge-option:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 107, 107, 0.5);
}

.merge-option input[type="radio"] {
    margin-right: 8px;
}

.merge-option span {
    font-weight: 500;
    color: rgba(255, 255, 255, 0.9);
    margin-bottom: 4px;
}

.merge-option small {
    color: rgba(255, 255, 255, 0.6);
    font-size: 12px;
}

.merge-mode-dropdown {
    width: 100%;
    padding: 8px 12px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 6px;
    color: #fff;
}

/* File History */
.file-history {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.file-history h4 {
    font-size: 14px;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.8);
    margin-bottom: 12px;
}

.file-history-list {
    max-height: 200px;
    overflow-y: auto;
}

.file-history-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 12px;
    background: rgba(255, 255, 255, 0.02);
    border-radius: 6px;
    margin-bottom: 8px;
}

.file-name {
    font-size: 13px;
    color: rgba(255, 255, 255, 0.8);
    flex: 1;
}

.file-action {
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 500;
    margin: 0 8px;
}

.file-action.merged {
    background: rgba(76, 175, 80, 0.2);
    color: #4caf50;
}

.file-action.replaced {
    background: rgba(255, 152, 0, 0.2);
    color: #ff9800;
}

.file-action.loaded {
    background: rgba(33, 150, 243, 0.2);
    color: #2196f3;
}

.file-time {
    font-size: 11px;
    color: rgba(255, 255, 255, 0.5);
}