/**
 * 豆瓣影视信息一键获取 - 前端样式
 */

/* 编辑器工具栏按钮 */
.zibll-douban-toolbar-btn {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px !important;
    margin-left: 5px;
    background: #2271b1 !important;
    border-color: #2271b1 !important;
    color: #fff !important;
    font-size: 13px;
    line-height: 1.4;
    border-radius: 3px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.zibll-douban-toolbar-btn:hover {
    background: #135e96 !important;
    border-color: #135e96 !important;
}

.zibll-douban-toolbar-btn .dashicons {
    font-size: 16px;
    width: 16px;
    height: 16px;
}

/* 模态框 */
.zibll-douban-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 100000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.zibll-douban-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(2px);
}

.zibll-douban-modal-content {
    position: relative;
    width: 90%;
    max-width: 600px;
    max-height: 80vh;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    overflow: hidden;
    animation: zibllDoubanModalIn 0.3s ease;
}

@keyframes zibllDoubanModalIn {
    from {
        opacity: 0;
        transform: scale(0.95) translateY(-20px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

/* 模态框头部 */
.zibll-douban-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
}

.zibll-douban-modal-header h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
}

.zibll-douban-modal-header .dashicons {
    font-size: 22px;
    width: 22px;
    height: 22px;
}

.zibll-douban-modal-close {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: #fff;
    font-size: 28px;
    line-height: 1;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    cursor: pointer;
    transition: background 0.2s;
}

.zibll-douban-modal-close:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* 模态框内容 */
.zibll-douban-modal-body {
    padding: 20px;
    max-height: calc(80vh - 60px);
    overflow-y: auto;
}

/* 搜索框 */
.zibll-douban-search-box {
    display: flex;
    gap: 10px;
    margin-bottom: 10px;
}

#zibll-douban-search-input {
    flex: 1;
    padding: 12px 16px;
    font-size: 15px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    outline: none;
    transition: border-color 0.2s;
}

#zibll-douban-search-input:focus {
    border-color: #667eea;
}

#zibll-douban-search-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 12px 20px !important;
    font-size: 14px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%) !important;
    border: none !important;
    border-radius: 8px;
    color: #fff !important;
    cursor: pointer;
    transition: opacity 0.2s;
}

#zibll-douban-search-btn:hover {
    opacity: 0.9;
}

#zibll-douban-search-btn .dashicons {
    font-size: 18px;
    width: 18px;
    height: 18px;
}

.zibll-douban-search-tips {
    font-size: 12px;
    color: #888;
    margin-bottom: 15px;
}

/* 搜索结果 */
#zibll-douban-results {
    margin-top: 10px;
}

/* 结果列表 */
.zibll-douban-results-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.zibll-douban-result-item {
    display: flex;
    gap: 12px;
    padding: 12px;
    background: #f8f9fa;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
    border: 2px solid transparent;
}

.zibll-douban-result-item:hover {
    background: #fff;
    border-color: #667eea;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.15);
}

.result-poster {
    flex-shrink: 0;
    width: 60px;
    height: 80px;
    border-radius: 4px;
    overflow: hidden;
    background: #eee;
}

.result-poster img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

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

.result-info h4 {
    margin: 0 0 6px;
    font-size: 15px;
    font-weight: 600;
    color: #333;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.result-meta {
    margin: 0;
    font-size: 13px;
    color: #666;
}

.result-meta .year {
    margin-right: 12px;
}

.result-meta .id {
    color: #888;
    font-size: 12px;
}

/* 详情展示 */
.zibll-douban-detail {
    background: #f8f9fa;
    border-radius: 10px;
    overflow: hidden;
}

.detail-header {
    display: flex;
    gap: 16px;
    padding: 16px;
    background: #fff;
    border-bottom: 1px solid #eee;
}

.detail-poster {
    flex-shrink: 0;
    width: 100px;
    height: 140px;
    border-radius: 6px;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.detail-poster img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

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

.detail-info h3 {
    margin: 0 0 10px;
    font-size: 18px;
    font-weight: 600;
    color: #333;
}

.detail-info h3 .year {
    font-weight: 400;
    color: #888;
    font-size: 14px;
}

.detail-info p {
    margin: 0 0 6px;
    font-size: 13px;
    color: #555;
    line-height: 1.5;
}

.detail-info .rating {
    color: #e09015;
    font-weight: 600;
    font-size: 16px;
}

.detail-summary {
    padding: 16px;
    font-size: 14px;
    color: #555;
    line-height: 1.7;
}

.detail-summary strong {
    color: #333;
}

/* 插入按钮 */
.detail-actions {
    padding: 16px;
    text-align: center;
    background: #fff;
    border-top: 1px solid #eee;
}

#zibll-douban-insert-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 14px 32px !important;
    font-size: 15px !important;
    font-weight: 600;
    background: linear-gradient(135deg, #00b894 0%, #00a085 100%) !important;
    border: none !important;
    border-radius: 8px;
    color: #fff !important;
    cursor: pointer;
    transition: all 0.2s;
}

#zibll-douban-insert-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 184, 148, 0.4);
}

#zibll-douban-insert-btn .dashicons {
    font-size: 20px;
    width: 20px;
    height: 20px;
}

/* 加载状态 */
.zibll-douban-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 40px;
    color: #666;
    font-size: 14px;
}

.zibll-douban-loading .spinner {
    float: none;
    margin: 0;
}

/* 空状态 */
.zibll-douban-empty {
    text-align: center;
    padding: 40px;
    color: #888;
    font-size: 14px;
}

/* 错误提示 */
.zibll-douban-error {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 20px;
    background: #fff5f5;
    color: #c53030;
    border-radius: 8px;
    font-size: 14px;
}

.zibll-douban-error .dashicons {
    font-size: 20px;
    width: 20px;
    height: 20px;
}

/* 成功通知 */
.zibll-douban-notice {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 100001;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 14px 20px;
    background: #fff;
    color: #333;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    font-size: 14px;
    animation: zibllDoubanNoticeIn 0.3s ease;
}

.zibll-douban-notice .dashicons {
    color: #00b894;
    font-size: 20px;
    width: 20px;
    height: 20px;
}

@keyframes zibllDoubanNoticeIn {
    from {
        opacity: 0;
        transform: translateX(20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* 短代码样式 - 卡片模式 */
.douban-movie-card {
    display: flex;
    gap: 16px;
    padding: 16px;
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
    margin: 16px 0;
    position: relative;
    overflow: hidden;
}

.douban-movie-card .douban-movie-poster {
    flex-shrink: 0;
    width: 80px;
    height: 110px;
    border-radius: 6px;
    overflow: hidden;
    background: #eee;
}

.douban-movie-card .douban-movie-poster img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

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

.douban-movie-card .douban-movie-info h4 {
    margin: 0 0 8px;
    font-size: 16px;
    font-weight: 600;
    color: #333;
}

.douban-movie-card .douban-movie-meta {
    display: flex;
    gap: 12px;
    margin-bottom: 8px;
    font-size: 13px;
}

.douban-movie-card .douban-movie-meta .year {
    color: #888;
}

.douban-movie-card .douban-movie-meta .rating {
    color: #e09015;
    font-weight: 600;
}

.douban-movie-card .douban-movie-actors {
    margin: 0;
    font-size: 13px;
    color: #666;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.douban-movie-card .douban-link {
    position: absolute;
    right: 12px;
    bottom: 12px;
    font-size: 12px;
    color: #667eea;
    text-decoration: none;
}

.douban-movie-card .douban-link:hover {
    text-decoration: underline;
}

/* 短代码样式 - 简单模式 */
.douban-movie-simple {
    display: inline-block;
    padding: 8px 16px;
    background: #f5f5f5;
    border-radius: 20px;
    font-size: 14px;
    margin: 8px 0;
}

.douban-movie-simple strong {
    color: #333;
}

/* 短代码样式 - 完整模式 */
.douban-movie-full {
    display: flex;
    gap: 24px;
    padding: 24px;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    margin: 20px 0;
}

.douban-movie-full .douban-movie-poster {
    flex-shrink: 0;
    width: 180px;
    height: 250px;
    border-radius: 8px;
    overflow: hidden;
    background: #eee;
}

.douban-movie-full .douban-movie-poster img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.douban-movie-full .douban-movie-info {
    flex: 1;
    min-width: 0;
}

.douban-movie-full .douban-movie-info h3 {
    margin: 0 0 16px;
    font-size: 22px;
    font-weight: 600;
    color: #333;
}

.douban-movie-full .douban-movie-info p {
    margin: 0 0 8px;
    font-size: 14px;
    color: #555;
    line-height: 1.6;
}

.douban-movie-full .douban-movie-info strong {
    color: #333;
}

.douban-movie-full .douban-movie-info .rating {
    color: #e09015;
    font-weight: 600;
    font-size: 18px;
}

/* 响应式 */
@media screen and (max-width: 768px) {
    .zibll-douban-modal-content {
        width: 95%;
        max-height: 90vh;
    }

    .zibll-douban-modal-header {
        padding: 12px 16px;
    }

    .zibll-douban-modal-header h3 {
        font-size: 16px;
    }

    .zibll-douban-modal-body {
        padding: 16px;
    }

    .detail-header {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }

    .detail-poster {
        width: 120px;
        height: 168px;
    }

    .douban-movie-full {
        flex-direction: column;
        padding: 16px;
    }

    .douban-movie-full .douban-movie-poster {
        width: 100%;
        height: auto;
        aspect-ratio: 2/3;
        max-width: 200px;
        margin: 0 auto;
    }
}
