/* データベースシミュレータメインスタイル */

.app-container {
    display: flex;
    flex-direction: column;
    height: 100vh;
    width: 100%;
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* ツールバー */
.toolbar {
    background: linear-gradient(135deg, #4f46e5, #6366f1);
    color: white;
    padding: 0.5rem 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    z-index: 100;
    flex-shrink: 0;
}

.toolbar-title {
    font-size: 1.25rem;
    font-weight: bold;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.toolbar-buttons {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.toolbar-btn {
    background: rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: white;
    padding: 0.4rem 0.8rem;
    border-radius: 0.5rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.85rem;
}

.toolbar-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.toolbar-btn:active {
    transform: translateY(0);
}

.toolbar-checkbox {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    color: white;
    font-weight: 500;
    cursor: pointer;
    padding: 0.4rem 0.8rem;
    border-radius: 0.5rem;
    transition: background 0.2s;
    font-size: 0.85rem;
}

.toolbar-checkbox:hover {
    background: rgba(255, 255, 255, 0.1);
}

.toolbar-checkbox input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

/* メインキャンバス */
.main-canvas {
    flex: 1;
    position: relative;
    overflow: hidden;
    background: #f1f5f9;
}

.canvas-container {
    width: 100%;
    height: 100%;
    position: relative;
}

#database-canvas {
    width: 100%;
    height: 100%;
    cursor: default;
    touch-action: none;
}

/* ヘルプパネル */
.help-panel {
    display: none; /* デフォルトは非表示 */
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: white;
    border-radius: 1rem;
    padding: 1rem;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    max-width: 300px;
    z-index: 50;
    pointer-events: auto;
}

.help-panel.show {
    display: block;
}

.help-panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
}

.help-panel h3 {
    font-size: 1rem;
    color: #1e293b;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin: 0;
}

.help-close-btn {
    background: none;
    border: none;
    color: #64748b;
    cursor: pointer;
    font-size: 1.5rem;
    line-height: 1;
    padding: 0;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.2s;
}

.help-close-btn:hover {
    color: #1e293b;
}

.help-item {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
    font-size: 0.85rem;
    color: #64748b;
}

.help-icon {
    font-size: 1.25rem;
    flex-shrink: 0;
}

.help-text {
    line-height: 1.4;
}

/* 削除エリア */
.delete-area {
    display: none;
    position: absolute;
    bottom: 9rem;
    right: 2rem;
    width: 200px;
    height: 150px;
    background: rgba(239, 68, 68, 0.9);
    border: 3px dashed rgba(255, 255, 255, 0.8);
    border-radius: 1rem;
    z-index: 40;
    pointer-events: none;
    transition: all 0.2s;
}

.delete-area.show {
    display: flex;
    align-items: center;
    justify-content: center;
}

.delete-area.hover {
    background: rgba(220, 38, 38, 1);
    transform: scale(1.05);
    box-shadow: 0 8px 20px rgba(220, 38, 38, 0.5);
}

.delete-area-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    color: white;
}

.delete-icon {
    font-size: 3rem;
}

.delete-text {
    font-size: 1rem;
    font-weight: bold;
    text-align: center;
}

/* レスポンシブ */
@media (max-width: 768px) {
    .toolbar {
        padding: 0.5rem;
        flex-direction: column;
        gap: 0.5rem;
    }

    .toolbar-title {
        font-size: 1.1rem;
    }

    .toolbar-buttons {
        width: 100%;
        justify-content: center;
    }

    .toolbar-btn {
        padding: 0.4rem 0.7rem;
        font-size: 0.8rem;
    }

    .help-panel {
        top: auto;
        bottom: 1rem;
        right: 1rem;
        max-width: calc(100vw - 2rem);
    }
}

/* タッチデバイス用の最適化 */
@media (hover: none) and (pointer: coarse) {
    .toolbar-btn {
        padding: 0.5rem 0.8rem;
        min-height: 40px;
        font-size: 0.9rem;
    }
}
