/**
 * Nex Port Data System - 港口详情弹窗样式
 *
 * @package    Nex_Port_Data_System
 * @subpackage Public\CSS
 * @author     Caton
 * @since      1.0.0
 */

/* ============================================================
   弹窗容器
   ============================================================ */

#nex-port-detail-modal {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    color: #333;
}

/* ============================================================
   内容区域
   ============================================================ */

.nex-modal-content {
    padding: 24px 28px 28px;
}

.nex-modal-content::-webkit-scrollbar {
    width: 6px;
}

.nex-modal-content::-webkit-scrollbar-track {
    background: #f5f5f5;
    border-radius: 3px;
}

.nex-modal-content::-webkit-scrollbar-thumb {
    background: #ddd;
    border-radius: 3px;
}

.nex-modal-content::-webkit-scrollbar-thumb:hover {
    background: #ccc;
}

/* ============================================================
   头部
   ============================================================ */

.nex-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    flex-wrap: wrap;
    gap: 12px;
    padding-bottom: 16px;
    border-bottom: 2px solid #f0f0f0;
    margin-bottom: 16px;
}

.nex-modal-title h2 {
    margin: 0;
    font-size: 24px;
    font-weight: 600;
    color: #222;
}

.nex-modal-name-zh {
    display: inline-block;
    margin-top: 4px;
    font-size: 16px;
    color: #888;
    font-weight: 400;
}

.nex-modal-badge {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    padding-top: 4px;
}

.nex-badge {
    display: inline-block;
    padding: 4px 14px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 500;
}

/* ============================================================
   元数据
   ============================================================ */

.nex-modal-meta {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 8px 16px;
    background: #f8f9fa;
    padding: 12px 16px;
    border-radius: 8px;
    margin-bottom: 16px;
}

.nex-meta-item {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: #555;
}

.nex-meta-icon {
    font-size: 16px;
}

/* ============================================================
   描述
   ============================================================ */

.nex-modal-description {
    margin-bottom: 16px;
}

.nex-modal-description h4 {
    margin: 0 0 8px;
    font-size: 15px;
    color: #444;
}

.nex-modal-description p {
    margin: 0;
    font-size: 14px;
    line-height: 1.7;
    color: #555;
    background: #fafafa;
    padding: 12px 16px;
    border-radius: 6px;
    border-left: 4px solid #2271b1;
}

/* ============================================================
   AI 摘要
   ============================================================ */

.nex-modal-ai-container {
    margin: 16px 0;
    min-height: 80px;
}

.nex-ai-summary {
    background: linear-gradient(135deg, #f0f7ff 0%, #e8f0fe 100%);
    border-radius: 8px;
    padding: 16px 20px;
    border: 1px solid #d0e4f7;
}

.nex-ai-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
    flex-wrap: wrap;
}

.nex-ai-icon {
    font-size: 20px;
}

.nex-ai-title {
    font-weight: 600;
    font-size: 15px;
    color: #1a3a6b;
}

.nex-ai-badge {
    font-size: 11px;
    background: #2271b1;
    color: #fff;
    padding: 2px 10px;
    border-radius: 12px;
    opacity: 0.8;
}

.nex-ai-body {
    font-size: 14px;
    line-height: 1.7;
    color: #333;
}

.nex-ai-body p {
    margin: 0 0 6px;
}

.nex-ai-meta {
    font-size: 12px;
    color: #888;
    margin-top: 6px;
}

.nex-ai-actions {
    margin-top: 10px;
}

.nex-ai-view-full {
    background: none;
    border: none;
    color: #2271b1;
    cursor: pointer;
    font-size: 13px;
    padding: 4px 0;
    text-decoration: underline;
}

.nex-ai-view-full:hover {
    color: #135e96;
}

.nex-ai-loading {
    text-align: center;
    padding: 20px;
    color: #999;
}

.nex-ai-placeholder {
    text-align: center;
    padding: 20px;
    color: #999;
    background: #f8f9fa;
    border-radius: 6px;
}

.nex-ai-empty {
    text-align: center;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 6px;
}

.nex-ai-empty p {
    margin: 0 0 10px;
    color: #999;
}

.nex-ai-generate-btn {
    padding: 8px 24px;
    background: #2271b1;
    color: #fff;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    cursor: pointer;
    transition: background 0.2s;
}

.nex-ai-generate-btn:hover {
    background: #135e96;
}

.nex-ai-generate-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.nex-ai-error {
    text-align: center;
    padding: 20px;
    color: #dc3232;
    background: #fff5f5;
    border-radius: 6px;
}

/* ============================================================
   加载状态
   ============================================================ */

.nex-modal-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    color: #999;
}

.nex-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #f0f0f0;
    border-top-color: #2271b1;
    border-radius: 50%;
    animation: nex-spin 0.8s linear infinite;
    margin-bottom: 16px;
}

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

/* ============================================================
   错误状态
   ============================================================ */

.nex-modal-error {
    text-align: center;
    padding: 40px 20px;
}

.nex-modal-error p {
    color: #dc3232;
    font-size: 16px;
    margin-bottom: 16px;
}

.nex-btn-retry {
    padding: 8px 24px;
    background: #dc3232;
    color: #fff;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    cursor: pointer;
    transition: background 0.2s;
}

.nex-btn-retry:hover {
    background: #b71c1c;
}

/* ============================================================
   操作按钮
   ============================================================ */

.nex-modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding-top: 16px;
    border-top: 1px solid #f0f0f0;
    margin-top: 8px;
}

.nex-btn-close {
    padding: 8px 24px;
    background: #f0f0f0;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    cursor: pointer;
    color: #555;
    transition: background 0.2s;
}

.nex-btn-close:hover {
    background: #e0e0e0;
}

/* ============================================================
   响应式
   ============================================================ */

@media (max-width: 768px) {
    #nex-port-detail-modal {
        max-width: 96%;
        width: 96%;
        max-height: 95vh;
        border-radius: 8px;
    }

    .nex-modal-content {
        padding: 16px 18px 20px;
    }

    .nex-modal-header {
        flex-direction: column;
        align-items: stretch;
    }

    .nex-modal-title h2 {
        font-size: 20px;
    }

    .nex-modal-meta {
        grid-template-columns: 1fr 1fr;
        gap: 4px 12px;
        padding: 10px 12px;
    }

    .nex-ai-summary {
        padding: 12px 14px;
    }

    .nex-modal-actions {
        flex-direction: column;
    }

    .nex-modal-actions button {
        width: 100%;
        text-align: center;
        padding: 10px;
    }
}

@media (max-width: 480px) {
    .nex-modal-meta {
        grid-template-columns: 1fr;
    }

    .nex-modal-title h2 {
        font-size: 18px;
    }

    .nex-modal-content {
        padding: 12px 14px 16px;
    }

    .nex-ai-header {
        flex-wrap: wrap;
    }
}