/* ========================================
   Modal
   ======================================== */

.modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 500;
    animation: fadeIn 0.2s ease;
}

.modal.show {
    display: flex;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.modal-content {
    background: var(--bg-primary);
    border-radius: 8px;
    box-shadow: var(--shadow-lg);
    width: 90%;
    max-width: 400px;
    animation: slideDown 0.2s ease;
}

.modal-large {
    max-width: 80vw;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
}

.modal-wide {
    max-width: 600px;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-32px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.modal-header {
    padding: 24px;
    border-bottom: 1px solid var(--border-light);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h2 {
    font-size: 20px;
    font-weight: 500;
    color: var(--text-primary);
}

.modal-close {
    background: none;
    border: none;
    font-size: 28px;
    color: var(--text-secondary);
    cursor: pointer;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: var(--transition);
}

.modal-close:hover {
    background-color: var(--hover-bg);
    color: var(--text-primary);
}

.modal-body {
    padding: 24px;
    flex: 1;
    overflow: auto;
    min-height: 0;
}

.modal-footer {
    padding: 16px 24px;
    border-top: 1px solid var(--border-light);
    display: flex;
    gap: 12px;
    justify-content: flex-end;
    flex-shrink: 0;
}

/* Compression Modal Specifics (found at the end of style.css) */
.compress-level-labels {
    display: flex;
    justify-content: space-between;
    margin-top: 8px;
    font-size: 12px;
    color: var(--text-secondary);
}

#compressLevelValue {
    font-weight: bold;
    color: var(--primary);
}

.compress-info {
    margin-top: 16px;
    padding: 12px;
    background: var(--primary-light);
    border-radius: 4px;
    font-size: 14px;
    color: var(--text-primary);
}

/* Modal Utilities (New) */
.modal-info-box {
    background: var(--bg-secondary);
    padding: 16px;
    border-radius: 8px;
    margin-bottom: 24px;
    display: flex;
    align-items: flex-start;
    gap: 16px;
    border: 1px solid var(--border);
}

.modal-info-icon {
    background: var(--bg-primary);
    padding: 8px;
    border-radius: 50%;
    color: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow-sm);
    flex-shrink: 0;
}

.modal-info-icon svg {
    width: 20px;
    height: 20px;
}

.modal-info-text {
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.6;
    padding-top: 2px;
}

.modal-label {
    font-weight: 600;
    font-size: 12px;
    color: var(--text-secondary);
    margin-bottom: 8px;
    display: block;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.modal-footer button {
    min-width: 100px;
    justify-content: center;
}

/* ========================================
   Move Dialog
   ======================================== */

.move-path-display {
    padding: 12px 16px;
    margin-bottom: 16px;
    background-color: var(--bg-primary);
    border-radius: 8px;
    border: 1px solid var(--border);
    font-size: 14px;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 8px;
    box-shadow: var(--shadow-sm);
}

.move-path-display::before {
    content: '';
    display: block;
    width: 18px;
    height: 18px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%235f6368' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3 9l9-7 9 7v11a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z'%3E%3C/path%3E%3Cpolyline points='9 22 9 12 15 12 15 22'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: center;
    background-size: contain;
    opacity: 0.7;
}

.move-path-display span {
    color: var(--text-primary);
    font-weight: 600;
    font-family: monospace; /* パスが見やすいように */
}

.move-folder-list {
    height: 320px;
    overflow-y: auto;
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 8px;
    background-color: var(--bg-primary); /* リスト背景を白に */
}

/* スクロールバーのカスタマイズ */
.move-folder-list::-webkit-scrollbar {
    width: 8px;
}
.move-folder-list::-webkit-scrollbar-track {
    background: transparent;
}
.move-folder-list::-webkit-scrollbar-thumb {
    background-color: rgba(0, 0, 0, 0.2);
    border-radius: 4px;
}

.move-folder-item {
    padding: 10px 12px;
    cursor: pointer;
    border-radius: 6px;
    display: flex;
    align-items: center;
    gap: 12px;
    transition: all 0.2s ease;
    font-size: 14px;
    color: var(--text-primary);
    border: 1px solid transparent; /* ホバー時の枠線用 */
    margin-bottom: 2px;
}

.move-folder-item:hover {
    background-color: var(--bg-secondary);
    border-color: var(--border-light);
}

.move-folder-item:active {
    background-color: var(--bg-hover);
}

/* アイコンスタイル */
.move-folder-icon {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    background-color: rgba(95, 99, 104, 0.1); /* 薄いグレー背景 */
    color: var(--text-secondary);
    flex-shrink: 0;
}

.move-folder-icon svg {
    width: 20px;
    height: 20px;
}

/* 通常のフォルダアイコン */
.move-folder-item:not(.is-parent) .move-folder-icon {
    color: #5f6368; /* Gmail/Driveのグレー */
    background-color: transparent;
}
.move-folder-item:not(.is-parent) .move-folder-icon svg {
    fill: currentColor;
    width: 24px;
    height: 24px;
}

/* 親フォルダアイコン */
.move-folder-item.is-parent .move-folder-icon {
    background-color: transparent;
    color: var(--primary);
}

.move-folder-name {
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-weight: 500;
}

.move-folder-list .loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: var(--text-secondary);
    gap: 12px;
}

.move-folder-list .loading::after {
    content: '';
    width: 24px;
    height: 24px;
    border: 2px solid var(--border);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

.move-folder-list .empty,
.move-folder-list .error {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: var(--text-secondary);
    font-size: 14px;
    padding: 24px;
    text-align: center;
    background-color: var(--bg-secondary);
    border-radius: 4px;
    margin: 8px;
}

.move-folder-list .error {
    color: var(--danger);
    background-color: rgba(220, 53, 69, 0.1);
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

