/* NMA Media Manager Block Styles */

.nma-media-manager-block,
.nma-media-manager-block-editor {
    border: 2px solid #3858e9;
    border-radius: 4px;
    padding: 32px;
    background: #f9f9f9;
    margin: 20px 0;
}

/* ヘッダー */
.nma-media-manager-header {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 16px;
    color: #1e1e1e;
}

.nma-media-manager-header .dashicons {
    font-size: 24px;
    width: 24px;
    height: 24px;
}

/* 説明文 */
.nma-media-manager-description {
    color: #1e1e1e;
    font-size: 14px;
    line-height: 1.5;
    margin: 0 0 24px 0;
}

/* ボタングループ */
.nma-media-manager-buttons {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

/* ボタン共通スタイル */
.nma-media-manager-button {
    display: inline-block;
    padding: 10px 24px;
    font-size: 14px;
    font-weight: 500;
    text-decoration: none;
    border-radius: 3px;
    cursor: pointer;
    transition: all 0.2s ease;
    border: 2px solid #3858e9;
}

/* プライマリボタン（アップロード） */
.nma-media-manager-button-primary {
    background: #3858e9;
    color: #ffffff;
}

.nma-media-manager-button-primary:hover {
    background: #2845d6;
    color: #ffffff;
}

.nma-media-manager-button-primary:disabled {
    background: #8c8f94;
    border-color: #8c8f94;
    cursor: not-allowed;
}

/* セカンダリボタン（メディアライブラリ） */
.nma-media-manager-button-secondary {
    background: #ffffff;
    color: #3858e9;
}

.nma-media-manager-button-secondary:hover {
    background: #f0f0f0;
    color: #2845d6;
}

/* URLから挿入ボタン */
.nma-media-manager-button-url {
    background: #ffffff;
    color: #3858e9;
}

.nma-media-manager-button-url:hover {
    background: #f0f0f0;
    color: #2845d6;
}

.nma-media-manager-button-url-active {
    background: #1e1e1e;
    color: #ffffff;
    border-color: #1e1e1e;
}

.nma-media-manager-button-url-active:hover {
    background: #2c2c2c;
    color: #ffffff;
    border-color: #2c2c2c;
}

/* フォーカススタイル */
.nma-media-manager-button:focus {
    outline: 2px solid #3858e9;
    outline-offset: 2px;
}

/* ドキュメント表示（ボタンスタイル） */
/* エディター内のボタンスタイル */
.editor-styles-wrapper .nma-media-document-editor .wp-block-button__link {
    position: relative;
    white-space: nowrap;
}

.editor-styles-wrapper .nma-media-document-editor .wp-block-button__link::after {
    content: "";
    width: 1.4em;
    height: 1.4em;
    display: block;
    position: absolute;
    top: 50%;
    right: 15px;
    background-image: url(http://localhost:8000/cms/wp-content/themes/nma/img/icon_arrow.svg);
    background-size: contain;
    background-repeat: no-repeat;
    transform: translate(0, -50%);
}

/* フロントエンドのボタンスタイルはテーマのCSSを使用 */
/* .wp-block-buttons クラスを使用しているため、追加のスタイルは不要 */

/* リンクも折り返し禁止 */
.editor-styles-wrapper .nma-media-document-editor .nma-media-document-link,
.nma-media-document-link {
    white-space: nowrap;
}

/* プレースホルダー */
.nma-media-document-editor .wp-block-button__link:empty::before,
.nma-media-document-editor .nma-media-document-link:empty::before {
    content: 'テキストを追加...';
    color: #999;
    pointer-events: none;
}

/* ドキュメント表示（リンクスタイル） */
.nma-media-document-link {
    color: #3858e9;
    text-decoration: underline;
    font-size: 16px;
    transition: color 0.2s ease;
}

.nma-media-document-link:hover {
    color: #2845d6;
}

/* レスポンシブ対応 */
@media (max-width: 768px) {
    .nma-media-manager-block-editor {
        padding: 24px;
    }

    .nma-media-manager-buttons {
        flex-direction: column;
    }

    .nma-media-manager-button {
        width: 100%;
        text-align: center;
    }

    .nma-media-document-button {
        display: block;
        text-align: center;
    }
}
