/* ============================================================
 * IMAGE DETAIL — Modal chi tiết ảnh + Embed Code
 * ============================================================ */

.image-detail-modal {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 9999;
}

.image-detail-modal.active {
    display: flex;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.2s ease;
}

.image-detail-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.75);
}

.image-detail-content {
    position: relative;
    z-index: 1;
    background: var(--bg-secondary);
    border: 1px solid var(--border-primary);
    border-radius: 12px;
    box-shadow: var(--shadow-xl);
    width: 92%;
    max-width: 520px;
    max-height: 90vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.image-detail-close {
    position: absolute;
    top: 10px;
    right: 10px;
    z-index: 10;
    width: 30px;
    height: 30px;
    border-radius: 8px;
    border: none;
    background: rgba(0, 0, 0, 0.5);
    color: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    transition: background 0.15s ease;
}

.image-detail-close:hover {
    background: rgba(239, 68, 68, 0.8);
}

.image-detail-body {
    overflow: hidden;
    flex: 1;
}

.image-detail-info-panel {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
    min-width: 0;
}

.image-detail-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 14px;
    word-break: break-word;
}

.image-detail-table {
    width: 100%;
    border-collapse: collapse;
    table-layout: fixed;
    font-size: 0.82rem;
}

.image-detail-table th,
.image-detail-table td {
    padding: 8px 10px;
    text-align: left;
    vertical-align: top;
    border-bottom: 1px solid var(--border-primary);
}

.image-detail-table th {
    color: var(--text-tertiary);
    font-weight: 500;
    white-space: nowrap;
    width: 110px;
    font-size: 0.78rem;
}

.image-detail-table th i {
    margin-right: 5px;
    font-size: 0.7rem;
    width: 14px;
    text-align: center;
}

.image-detail-table td {
    color: var(--text-primary);
    word-break: break-all;
}

.detail-url-text {
    font-family: 'Courier New', monospace;
    font-size: 0.75rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    flex: 1;
    min-width: 0;
}

.detail-url-cell {
    display: flex !important;
    align-items: center;
    gap: 4px;
}

#detailOriginal {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.copy-inline {
    background: none;
    border: none;
    color: var(--text-tertiary);
    cursor: pointer;
    padding: 2px 5px;
    border-radius: 4px;
    font-size: 0.7rem;
    transition: color 0.15s ease, background 0.15s ease;
    vertical-align: middle;
}

.copy-inline:hover {
    color: var(--color-primary);
    background: var(--bg-tertiary);
}

/* Embed Code */
.embed-code-section {
    margin-top: 16px;
    padding-top: 14px;
    border-top: 1px solid var(--border-primary);
}

.embed-code-title {
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin: 0 0 10px 0;
}

.embed-code-title i {
    margin-right: 6px;
    font-size: 0.75rem;
    color: var(--text-tertiary);
}

.embed-code-tabs {
    display: flex;
    gap: 4px;
    margin-bottom: 8px;
}

.embed-tab {
    padding: 4px 12px;
    font-size: 0.72rem;
    font-weight: 600;
    border: 1px solid var(--border-primary);
    border-radius: 50px;
    background: var(--bg-tertiary);
    color: var(--text-secondary);
    cursor: pointer;
    transition: color 0.15s ease, background 0.15s ease;
}

.embed-tab:hover {
    border-color: var(--color-primary);
    color: var(--color-primary);
}

.embed-tab.active {
    background: var(--color-primary);
    border-color: var(--color-primary);
    color: #fff;
}

.embed-code-output {
    position: relative;
    background: var(--bg-primary);
    border: 1px solid var(--border-primary);
    border-radius: var(--radius-md);
    padding: 10px 40px 10px 12px;
    min-height: 38px;
    display: flex;
    align-items: center;
}

.embed-code-output code {
    font-family: 'Courier New', monospace;
    font-size: 0.72rem;
    color: var(--text-primary);
    word-break: break-all;
    line-height: 1.4;
    flex: 1;
    user-select: all;
}

.embed-copy-btn {
    position: absolute;
    right: 6px;
    top: 50%;
    transform: translateY(-50%);
    width: 28px;
    height: 28px;
    border: 1px solid var(--border-primary);
    border-radius: 6px;
    background: var(--bg-secondary);
    color: var(--text-tertiary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    transition: color 0.15s ease, background 0.15s ease;
}

.embed-copy-btn:hover {
    background: var(--color-primary);
    border-color: var(--color-primary);
    color: #fff;
}

/* ============================================================
 * RESPONSIVE — Image Detail
 * ============================================================ */
@media (max-width: 900px) {
    .image-detail-info-panel {
        padding: 14px;
    }

    .image-detail-table th {
        width: 90px;
    }
}
