/**
 * Eguweb Frontpage Drag & Drop Styles
 */

/* コントロールバー */
.eguweb-frontpage-dd-controls {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 9999;
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

/* ボタンの基本スタイル */
.eguweb-dd-button {
    padding: 8px 16px;
    border: none;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.eguweb-dd-button:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
}

.eguweb-dd-button:active {
    transform: translateY(0);
}

.eguweb-dd-button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

/* ボタンの種類別スタイル */
.eguweb-dd-button-primary {
    background-color: #2271b1;
    color: #fff;
}

.eguweb-dd-button-primary:hover:not(:disabled) {
    background-color: #135e96;
}

.eguweb-dd-button-success {
    background-color: #00a32a;
    color: #fff;
}

.eguweb-dd-button-success:hover:not(:disabled) {
    background-color: #007a20;
}

.eguweb-dd-button-secondary {
    background-color: #646970;
    color: #fff;
}

.eguweb-dd-button-secondary:hover:not(:disabled) {
    background-color: #50575e;
}

.eguweb-dd-button-danger {
    background-color: #d63638;
    color: #fff;
}

.eguweb-dd-button-danger:hover:not(:disabled) {
    background-color: #b32d2e;
}

/* ドラッグ可能な要素 */
.eguweb-draggable-content {
    position: relative;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.eguweb-dragging-enabled {
    border: 2px dashed transparent;
}

.eguweb-dragging-enabled:hover {
    border-color: #2271b1;
    box-shadow: 0 2px 8px rgba(34, 113, 177, 0.2);
}

/* リストアイテム用のスタイル */
.eguweb-draggable-content[data-drag-drop-list="true"] {
    cursor: move;
    cursor: grab;
}

.eguweb-draggable-content[data-drag-drop-list="true"]:active {
    cursor: grabbing;
}

.eguweb-draggable-content[data-drag-drop-list="true"].eguweb-dragging-enabled:hover {
    border-color: #2271b1;
    background-color: rgba(34, 113, 177, 0.05);
}

/* ドラッグハンドル */
.eguweb-drag-handle {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 32px;
    height: 32px;
    background-color: rgba(255, 255, 255, 0.9);
    border: 2px solid #2271b1;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: move;
    cursor: grab;
    z-index: 10;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    transition: all 0.2s ease;
}

.eguweb-drag-handle:hover {
    background-color: #2271b1;
    transform: scale(1.1);
}

.eguweb-drag-handle:active {
    cursor: grabbing;
    transform: scale(0.95);
}

.eguweb-drag-handle svg {
    width: 18px;
    height: 18px;
    stroke: #2271b1;
    transition: stroke 0.2s ease;
}

.eguweb-drag-handle:hover svg {
    stroke: #fff;
}

/* リストアイテム用のドラッグハンドル */
.eguweb-draggable-content[data-drag-drop-list="true"] .eguweb-drag-handle {
    top: 50%;
    right: 8px;
    transform: translateY(-50%);
    width: 24px;
    height: 24px;
    border-radius: 3px;
    opacity: 0.7;
}

.eguweb-draggable-content[data-drag-drop-list="true"] .eguweb-drag-handle:hover {
    opacity: 1;
    transform: translateY(-50%) scale(1.1);
}

.eguweb-draggable-content[data-drag-drop-list="true"] .eguweb-drag-handle svg {
    width: 14px;
    height: 14px;
}

/* ドラッグ中の状態 */
.eguweb-drag-ghost {
    opacity: 0.5;
    background-color: #f0f0f1;
    border: 2px dashed #2271b1;
}

.eguweb-drag-chosen {
    border: 2px solid #2271b1;
    box-shadow: 0 4px 12px rgba(34, 113, 177, 0.3);
    transform: scale(1.02);
}

.eguweb-drag-drag {
    opacity: 0.8;
    transform: rotate(2deg);
}

/* メッセージ */
.eguweb-dd-message {
    position: fixed;
    top: 80px;
    right: 20px;
    z-index: 10000;
    padding: 12px 20px;
    border-radius: 4px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.15);
    animation: slideIn 0.3s ease;
    max-width: 300px;
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.eguweb-dd-message-success {
    background-color: #00a32a;
    color: #fff;
}

.eguweb-dd-message-error {
    background-color: #d63638;
    color: #fff;
}

/* レスポンシブ対応 */
@media (max-width: 768px) {
    .eguweb-frontpage-dd-controls {
        bottom: 10px;
        right: 10px;
    }

    .eguweb-drag-handle {
        width: 28px;
        height: 28px;
        top: 5px;
        right: 5px;
    }

    .eguweb-drag-handle svg {
        width: 14px;
        height: 14px;
    }

    .eguweb-dd-message {
        top: 70px;
        right: 10px;
        left: 10px;
        max-width: none;
    }
}

/* 編集モード時の視覚的フィードバック */
body.eguweb-dd-edit-mode .eguweb-draggable-content {
    outline: 2px solid rgba(34, 113, 177, 0.3);
    outline-offset: 2px;
}

body.eguweb-dd-edit-mode .eguweb-draggable-content:hover {
    outline-color: #2271b1;
    outline-width: 2px;
}

/* アニメーション効果 */
.eguweb-draggable-content {
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

/* アクセシビリティ */
.eguweb-drag-handle:focus {
    outline: 2px solid #2271b1;
    outline-offset: 2px;
}

.eguweb-dd-button:focus {
    outline: 2px solid #2271b1;
    outline-offset: 2px;
}

/* 印刷時の非表示 */
@media print {
    .eguweb-frontpage-dd-controls,
    .eguweb-drag-handle,
    .eguweb-dd-message {
        display: none !important;
    }
}

