/* Projects Page Styles */

.projects-container {
    padding: 20px 40px 40px;
    min-height: 100vh;
}

/* Projects Header */
.projects-header {
    margin-bottom: 32px;
    max-width: 1800px;
    margin-left: auto;
    margin-right: auto;
}

.projects-header-content {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
}

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

.projects-title-section p {
    font-size: 16px;
    color: var(--muted-foreground);
    margin-bottom: 24px;
}

/* Project Stats */
.project-stats {
    display: flex;
    gap: 32px;
    padding: 20px;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
}

.stat-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.stat-label {
    font-size: 12px;
    color: var(--muted-foreground);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.stat-value {
    font-size: 24px;
    font-weight: 600;
    color: var(--foreground);
}

/* Action Bar */
.action-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    padding: 20px;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    flex-wrap: wrap;
    gap: 16px;
    max-width: 1800px;
    margin-left: auto;
    margin-right: auto;
}

.action-left,
.action-right {
    display: flex;
    gap: 12px;
    align-items: center;
}

/* Search Box */
.search-box {
    position: relative;
    display: flex;
    align-items: center;
    background: var(--background);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 0 12px;
    min-width: 280px;
}

.search-box svg {
    color: var(--muted-foreground);
    margin-right: 8px;
}

.search-box input {
    background: transparent;
    border: none;
    padding: 10px 0;
    color: var(--foreground);
    width: 100%;
    outline: none;
    font-size: 14px;
}

.search-box input::placeholder {
    color: var(--muted-foreground);
}

/* Filter and Sort Selects */
#filterType,
#sortBy {
    padding: 10px 16px;
    background: var(--background);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--foreground);
    font-size: 14px;
    cursor: pointer;
    outline: none;
    transition: all 0.2s ease;
}

#filterType:hover,
#sortBy:hover {
    border-color: var(--accent);
}

/* Action Buttons */
.btn-action {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    border-radius: var(--radius);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    border: 1px solid transparent;
}

.btn-backup {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.btn-backup:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(102, 126, 234, 0.3);
}

.btn-export {
    background: var(--accent);
    color: var(--accent-foreground);
    border-color: var(--border);
}

.btn-export:hover {
    background: var(--accent-hover);
    transform: translateY(-2px);
}

.btn-import {
    background: var(--background);
    color: var(--foreground);
    border-color: var(--border);
}

.btn-import:hover {
    background: var(--accent);
    transform: translateY(-2px);
}

/* Projects Grid */
.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 28px;
    min-height: 400px;
    max-width: 1800px;
    margin: 0 auto;
}

/* Project Card */
.project-card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: calc(var(--radius) * 2);
    overflow: hidden;
    transition: all 0.3s ease;
    cursor: pointer;
    position: relative;
}

.project-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
    border-color: var(--accent);
}

.project-card-header {
    padding: 20px;
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.1) 0%, rgba(118, 75, 162, 0.1) 100%);
    border-bottom: 1px solid var(--border);
}

.project-type-badge {
    display: inline-block;
    padding: 4px 8px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border-radius: 4px;
    margin-bottom: 8px;
}

.type-storyboard {
    background: rgba(59, 130, 246, 0.2);
    color: #3b82f6;
}

.type-conceptart {
    background: rgba(168, 85, 247, 0.2);
    color: #a855f7;
}

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

.project-card-body {
    padding: 20px;
}

.project-card-description {
    color: var(--muted-foreground);
    font-size: 14px;
    line-height: 1.6;
    margin-bottom: 16px;
    min-height: 40px;
}

.project-card-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 12px;
    color: var(--muted-foreground);
    margin-bottom: 16px;
}

.project-card-actions {
    display: flex;
    gap: 8px;
}

.card-btn {
    flex: 1;
    padding: 8px 12px;
    border: 1px solid var(--border);
    background: var(--background);
    color: var(--foreground);
    border-radius: var(--radius);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
}

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

.card-btn-restore {
    background: rgba(34, 197, 94, 0.1);
    border-color: rgba(34, 197, 94, 0.3);
    color: #22c55e;
}

.card-btn-restore:hover {
    background: rgba(34, 197, 94, 0.2);
}

.card-btn-delete {
    background: rgba(239, 68, 68, 0.1);
    border-color: rgba(239, 68, 68, 0.3);
    color: #ef4444;
}

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

/* Empty State */
.empty-state {
    text-align: center;
    padding: 80px 20px;
    color: var(--muted-foreground);
}

.empty-state svg {
    margin-bottom: 24px;
    opacity: 0.5;
}

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

.empty-state p {
    font-size: 16px;
    margin-bottom: 24px;
}

.empty-state .btn-primary {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: var(--radius);
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.empty-state .btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(102, 126, 234, 0.4);
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(5px);
    z-index: 1000;
    align-items: center;
    justify-content: center;
}

.modal.show {
    display: flex;
}

.modal-content {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: calc(var(--radius) * 2);
    width: 90%;
    max-width: 600px;
    max-height: 90vh;
    overflow-y: auto;
}

.modal-content.large {
    max-width: 900px;
}

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

.modal-header h2 {
    font-size: 20px;
    font-weight: 600;
    color: var(--foreground);
}

.modal-close {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--background);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--muted-foreground);
    font-size: 20px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.modal-close:hover {
    background: var(--accent);
    color: var(--foreground);
}

.modal-body {
    padding: 24px;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    padding: 24px;
    border-top: 1px solid var(--border);
}

/* Form Styles */
.backup-form .form-group {
    margin-bottom: 20px;
}

.backup-form label {
    display: block;
    font-size: 14px;
    font-weight: 500;
    color: var(--foreground);
    margin-bottom: 8px;
}

.backup-form input,
.backup-form select,
.backup-form textarea {
    width: 100%;
    padding: 10px 12px;
    background: var(--background);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--foreground);
    font-size: 14px;
    outline: none;
    transition: all 0.2s ease;
}

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

.backup-form textarea {
    resize: vertical;
    font-family: inherit;
}

.backup-info {
    display: flex;
    gap: 12px;
    padding: 12px;
    background: rgba(102, 126, 234, 0.1);
    border: 1px solid rgba(102, 126, 234, 0.2);
    border-radius: var(--radius);
}

.backup-info svg {
    flex-shrink: 0;
    color: #667eea;
}

.backup-info p {
    margin: 0;
    font-size: 13px;
    color: var(--muted-foreground);
    line-height: 1.5;
}

/* Project Details */
.project-meta {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 16px;
    padding: 20px;
    background: var(--background);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    margin-bottom: 20px;
}

.meta-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.meta-label {
    font-size: 12px;
    color: var(--muted-foreground);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.meta-value {
    font-size: 16px;
    font-weight: 600;
    color: var(--foreground);
}

.project-description {
    margin-bottom: 20px;
}

.project-description h3 {
    font-size: 16px;
    font-weight: 600;
    color: var(--foreground);
    margin-bottom: 8px;
}

.project-description p {
    color: var(--muted-foreground);
    line-height: 1.6;
}

.project-preview h3 {
    font-size: 16px;
    font-weight: 600;
    color: var(--foreground);
    margin-bottom: 8px;
}

.json-preview {
    background: var(--background);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 16px;
    font-family: 'Monaco', 'Courier New', monospace;
    font-size: 12px;
    color: var(--foreground);
    overflow-x: auto;
    max-height: 300px;
    overflow-y: auto;
}

/* Button Styles */
.btn-primary,
.btn-secondary,
.btn-warning,
.btn-danger {
    padding: 10px 20px;
    border-radius: var(--radius);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    border: none;
}

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

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(102, 126, 234, 0.3);
}

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

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

.btn-warning {
    background: rgba(251, 146, 60, 0.1);
    color: #fb923c;
    border: 1px solid rgba(251, 146, 60, 0.3);
}

.btn-warning:hover {
    background: rgba(251, 146, 60, 0.2);
}

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

.btn-danger:hover {
    background: rgba(239, 68, 68, 0.2);
}

/* Toast Notification */
.toast {
    position: fixed;
    bottom: 20px;
    right: 20px;
    padding: 16px 24px;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    transform: translateX(400px);
    transition: transform 0.3s ease;
    z-index: 1001;
    display: flex;
    align-items: center;
    gap: 12px;
}

.toast.show {
    transform: translateX(0);
}

.toast.success {
    border-left: 4px solid #22c55e;
}

.toast.error {
    border-left: 4px solid #ef4444;
}

.toast.info {
    border-left: 4px solid #3b82f6;
}

/* Responsive Design */
@media (max-width: 1440px) {
    .projects-grid {
        grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    }
}

@media (max-width: 1024px) {
    .projects-grid {
        grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
        gap: 20px;
    }
}

@media (max-width: 768px) {
    .projects-container {
        padding: 20px 20px 40px;
    }
    .projects-header-content {
        flex-direction: column;
        gap: 16px;
    }

    .project-stats {
        flex-wrap: wrap;
        gap: 16px;
    }

    .action-bar {
        flex-direction: column;
        align-items: stretch;
    }

    .action-left,
    .action-right {
        flex-wrap: wrap;
    }

    .search-box {
        min-width: 100%;
    }

    .projects-grid {
        grid-template-columns: 1fr;
    }

    .modal-content {
        width: 95%;
    }
}

/* Close Button - 프로필 관리와 동일한 스타일 */
.projects-container .btn-close {
    padding: 10px;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--muted-foreground);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.btn-close:hover {
    background: var(--accent);
    color: var(--foreground);
    border-color: var(--accent);
    transform: translateY(-2px);
}

.btn-close svg {
    width: 20px;
    height: 20px;
}

/* Mobile responsive for close button */
@media (max-width: 768px) {
    .projects-container .btn-close {
        padding: 10px;
    }
}