/**
 * 마이페이지 공통 CSS
 * - 사이드바 레이아웃 페이지용 공통 스타일
 */

/* 페이지 헤더 */
.page-header {
    position: relative;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    padding: 20px 24px;
    background: #ffffff;
    border: 1px solid #e8ecf1;
    border-radius: 12px;
    overflow: hidden;
    flex-wrap: wrap;
    gap: 16px;
}

.page-header-content {
    position: relative;
    z-index: 2;
    display: flex;
    align-items: center;
    gap: 16px;
}

.page-header-icon {
    width: 40px;
    height: 40px;
    background: #f5f5f5;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    padding: 8px;
}

.page-header-icon svg .st0 {
    stroke: #555;
    stroke-width: 2.5px;
}

.page-header-icon svg {
    color: #555;
}

.page-header-text {
    flex: 1;
}

.page-title {
    font-size: 18px;
    font-weight: 700;
    color: #1a1a1a;
    margin-bottom: 2px;
    line-height: 1.2;
}

.page-subtitle {
    font-size: 13px;
    color: #888;
    font-weight: 400;
}

.page-header-actions {
    position: relative;
    z-index: 2;
    display: flex;
    gap: 12px;
}

.btn-primary {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 18px;
    background: #ff6c0f;
    border: none;
    border-radius: 8px;
    color: #ffffff;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: opacity 0.2s;
    white-space: nowrap;
}

.btn-primary:hover {
    opacity: 0.9;
}

.btn-primary svg {
    width: 16px;
    height: 16px;
}

.btn-secondary {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 18px;
    background: #f5f5f5;
    border: 1px solid #ddd;
    border-radius: 8px;
    color: #555;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}

.btn-secondary:hover {
    background: #eee;
}

.btn-secondary.disabled {
    opacity: 0.5;
    cursor: not-allowed;
    pointer-events: none;
}

/* 검색/필터 섹션 */
.filter-section {
    display: flex;
    gap: 12px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.search-box {
    display: flex;
    align-items: center;
    gap: 12px;
    background: #ffffff;
    border: 2px solid #e8ecf1;
    border-radius: 12px;
    padding: 12px 16px;
    flex: 1;
    min-width: 200px;
    transition: all 0.3s ease;
}

.search-box:focus-within {
    border-color: #ff6c0f;
    box-shadow: 0 0 0 3px rgba(255, 108, 15, 0.1);
}

.search-box svg {
    color: #999;
    flex-shrink: 0;
}


.filter-select {
    padding: 12px 16px;
    background: #ffffff;
    border: 2px solid #e8ecf1;
    border-radius: 12px;
    font-size: 14px;
    color: #333;
    cursor: pointer;
    transition: all 0.3s ease;
    min-width: 150px;
}

.filter-select:focus {
    border-color: #ff6c0f;
    outline: none;
}

/* 카드 리스트 그리드 */
.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 16px;
}

/* 공통 카드 스타일 */
.card-item {
    background: #ffffff;
    border: 2px solid #e8ecf1;
    border-radius: 14px;
    padding: 20px;
    transition: all 0.3s ease;
}

.card-item:hover {
    border-color: #ff6c0f;
}

.card-header {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 16px;
}

.card-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    overflow: hidden;
    flex-shrink: 0;
    border: 2px solid #e8ecf1;
    background: #f5f7fa;
    display: flex;
    align-items: center;
    justify-content: center;
}

.card-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.card-avatar svg {
    width: 24px;
    height: 24px;
    color: #999;
}

.card-info {
    flex: 1;
    min-width: 0;
}

.card-name {
    font-size: 16px;
    font-weight: 600;
    color: #333;
    margin-bottom: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.card-desc {
    font-size: 13px;
    color: #999;
}

.card-body {
    padding-top: 12px;
    border-top: 1px solid #e8ecf1;
}

.card-actions {
    display: flex;
    gap: 8px;
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid #e8ecf1;
}

/* 버튼 스타일 */
.btn-action {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px 16px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    border: none;
    flex: 1;
}

.btn-action svg {
    width: 16px;
    height: 16px;
}

.btn-action-primary {
    background: #ff6c0f;
    color: #ffffff;
}

.btn-action-primary:hover {
    opacity: 0.9;
}

.btn-action-secondary {
    background: #f5f7fa;
    color: #656565;
    border: 2px solid #e8ecf1;
}

.btn-action-secondary:hover {
    background: #e8ecf1;
}

.btn-action-danger {
    background: #fff5f5;
    color: #ff4444;
    border: 2px solid #ffcccc;
}

.btn-action-danger:hover {
    background: #ffeeee;
    border-color: #ff4444;
}

/* 상태 뱃지 */
.status-badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
}

.status-badge.active,
.status-badge.approved {
    background: #e8f5e9;
    color: #2e7d32;
}

.status-badge.pending {
    background: #fff3e0;
    color: #f57c00;
}

.status-badge.inactive,
.status-badge.rejected {
    background: #ffebee;
    color: #c62828;
}

/* 빈 상태 */
.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 80px 20px;
    color: #999;
    text-align: center;
}

.empty-state svg {
    opacity: 0.5;
}

.empty-state p {
    font-size: 16px;
    margin: 0 0 20px 0;
}

.empty-state .btn-action {
    flex: none;
}

/* 컨텐츠 그리드 (썸네일 카드) */
.content-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 20px;
}

.content-card {
    background: #ffffff;
    border: 2px solid #e8ecf1;
    border-radius: 14px;
    overflow: hidden;
    transition: all 0.3s ease;
    cursor: pointer;
}

.content-card:hover {
    border-color: #ff6c0f;
}

.content-thumbnail {
    position: relative;
    padding-top: 56.25%;
    /* 16:9 비율 */
    background: #f5f7fa;
}

.content-thumbnail img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.content-thumbnail .play-icon {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 50px;
    height: 50px;
    background: rgba(255, 108, 15, 0.9);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: all 0.3s ease;
}

.content-card:hover .play-icon {
    opacity: 1;
}

.content-thumbnail .play-icon svg {
    width: 24px;
    height: 24px;
    color: #ffffff;
    margin-left: 4px;
}

.content-thumbnail .duration {
    position: absolute;
    bottom: 8px;
    right: 8px;
    background: rgba(0, 0, 0, 0.7);
    color: #ffffff;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 500;
}

.content-info {
    padding: 14px;
}

.content-title {
    font-size: 14px;
    font-weight: 600;
    color: #333;
    margin-bottom: 6px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.content-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    color: #999;
}

.content-meta span {
    display: flex;
    align-items: center;
    gap: 4px;
}

.content-meta svg {
    width: 14px;
    height: 14px;
}

/* 리스트 아이템 (가로형 카드) */
.list-item {
    display: flex;
    align-items: center;
    gap: 16px;
    background: #ffffff;
    border: 2px solid #e8ecf1;
    border-radius: 14px;
    padding: 16px;
    margin-bottom: 12px;
    transition: all 0.3s ease;
}

.list-item:hover {
    border-color: #ff6c0f;
}

.list-item-thumbnail {
    width: 120px;
    height: 68px;
    border-radius: 8px;
    overflow: hidden;
    flex-shrink: 0;
    background: #f5f7fa;
}

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

.list-item-content {
    flex: 1;
    min-width: 0;
}

.list-item-title {
    font-size: 15px;
    font-weight: 600;
    color: #333;
    margin-bottom: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.list-item-desc {
    font-size: 13px;
    color: #999;
    margin-bottom: 8px;
}

.list-item-meta {
    display: flex;
    gap: 12px;
    font-size: 12px;
    color: #656565;
}

.list-item-actions {
    display: flex;
    gap: 8px;
    flex-shrink: 0;
}

/* 탭 네비게이션 */
.tab-nav {
    display: flex;
    gap: 8px;
    margin-bottom: 20px;
    background: #f5f7fa;
    padding: 6px;
    border-radius: 12px;
}

.tab-btn {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 16px;
    border: none;
    background: transparent;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 600;
    color: #656565;
    cursor: pointer;
    transition: all 0.3s ease;
}

.tab-btn:hover {
    background: rgba(255, 108, 15, 0.08);
    color: #ff6c0f;
}

.tab-btn.active {
    background: #ffffff;
    color: #ff6c0f;
    box-shadow: none;
}

.tab-btn svg {
    width: 18px;
    height: 18px;
}

.tab-content {
    display: none;
}

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

/* 모달 */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 2000;
}

.modal.show {
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
}

.modal-content {
    position: relative;
    background: #ffffff;
    border-radius: 16px;
    max-width: 500px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

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

.modal-title {
    font-size: 18px;
    font-weight: 700;
    color: #333;
    margin: 0;
}

.modal-close {
    width: 32px;
    height: 32px;
    border: none;
    background: #f5f7fa;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.modal-close:hover {
    background: #ff6c0f;
    color: #ffffff;
}

.modal-body {
    padding: 24px;
}

.modal-footer {
    display: flex;
    gap: 12px;
    padding: 20px 24px;
    border-top: 2px solid #e8ecf1;
    justify-content: flex-end;
}

/* 폼 요소 */
.form-group {
    margin-bottom: 20px;
}

.form-label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: #333;
    margin-bottom: 8px;
}

.form-input {
    width: 100%;
    padding: 12px 16px;
    background: #f5f7fa;
    border: 2px solid #e8ecf1;
    border-radius: 10px;
    font-size: 14px;
    color: #333;
    transition: all 0.3s ease;
}

.form-input:focus {
    border-color: #ff6c0f;
    outline: none;
    background: #ffffff;
}

.form-input::placeholder {
    color: #999;
}

/* 반응형 */
@media (max-width: 768px) {

    .page-header {
        padding: 16px 20px;
        gap: 12px;
    }

    .page-header-content {
        gap: 12px;
    }

    .page-header-icon {
        width: 40px;
        height: 40px;
        padding: 8px;
    }

    .page-title {
        font-size: 17px;
    }

    .page-subtitle {
        font-size: 12px;
    }

    .page-header-actions {
        width: 100%;
    }

    .btn-primary {
        flex: 1;
        justify-content: center;
    }

    .filter-section {
        flex-direction: column;
    }

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

    .content-grid {
        grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
        gap: 12px;
    }

    .list-item {
        flex-wrap: wrap;
    }

    .list-item-thumbnail {
        width: 100%;
        height: auto;
        aspect-ratio: 16/9;
    }

    .list-item-actions {
        width: 100%;
        margin-top: 12px;
        padding-top: 12px;
        border-top: 1px solid #e8ecf1;
    }

    .tab-nav {
        flex-direction: column;
    }
}

/* 페이지 안내 박스 */
.guide-box {
    background: #f8f9fb;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    padding: 16px 20px;
    margin-bottom: 20px;
}

.guide-box .guide-text {
    font-size: 14px;
    color: #374151;
    font-weight: 600;
    margin-bottom: 8px;
    line-height: 1.5;
}

.guide-box .guide-list {
    margin: 0;
    padding-left: 18px;
    font-size: 13px;
    color: #6b7280;
    line-height: 1.8;
}

/* 모달 폼 도움말 텍스트 */
.form-help-text {
    font-size: 12px;
    color: #9ca3af;
    margin-bottom: 12px;
}

/* 폼 필드 인라인 힌트 */
.form-hint {
    font-size: 12px;
    color: #9ca3af;
    margin-top: 4px;
}