body {
    margin: 0;
    padding: 0;
    padding-top: 60px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

#header {
    box-shadow: #2f2f2f11 0px 2px 5px 2px;
}

.editor-container {
    position: fixed;
    top: 60px;
    left: 0;
    right: 0;
    bottom: 0;
}

#monaco-editor {
    width: 100%;
    height: 100%;
}

/* ローディングオーバーレイ */
.loading-overlay {
    position: fixed;
    top: 60px;
    left: 0;
    right: 0;
    bottom: 0;
    background: #fafafa;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 9999;
}

.loading-overlay.hidden {
    display: none;
}

.loading-spinner {
    width: 50px;
    height: 50px;
    border: 4px solid #e5e7eb;
    border-top: 4px solid #8b5cf6;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

.loading-overlay p {
    margin-top: 20px;
    color: #6b7280;
    font-size: 14px;
}

/*
 ヘッダーメニュー */
.header-menu {
    display: flex;
    gap: 5px;
    margin-left: 20px;
}

.menu-item {
    position: relative;
    padding: 8px 12px;
    cursor: pointer;
    color: #374151;
    font-size: 14px;
    font-weight: 500;
    border-radius: 4px;
    transition: background 0.2s;
    user-select: none;
}

.menu-item:hover {
    background: rgba(255, 255, 255, 0.15);
}

.menu-item.active {
    background: rgba(255, 255, 255, 0.2);
}

.dropdown-menu {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    min-width: 180px;
    margin-top: 4px;
    z-index: 1000;
    opacity: 0;
    transform: translateY(-8px);
    transition: opacity 0.2s ease, transform 0.2s ease;
    pointer-events: none;
}

.menu-item.active .dropdown-menu {
    display: block;
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

.menu-option {
    padding: 10px 16px;
    color: #374151;
    cursor: pointer;
    font-size: 13px;
    transition: background 0.15s ease, color 0.15s ease;
    position: relative;
}

.menu-option:hover {
    background: #f3f4f6;
    color: #1f2937;
}

.menu-option:active {
    background: #e5e7eb;
}

.menu-option:first-child {
    border-radius: 6px 6px 0 0;
}

.menu-option:last-child {
    border-radius: 0 0 6px 6px;
}

/* 
保存ステータス */
.save-status {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-left: 16px;
    padding: 6px 12px;
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.1);
    transition: all 0.3s ease;
}

.save-icon {
    font-size: 18px;
    color: #ffffff;
    transition: all 0.3s ease;
}

.save-text {
    font-size: 12px;
    color: #ffffff;
    font-weight: 500;
}

/* 保存済み */
.save-status.saved .save-icon {
    color: #10b981;
}

.save-status.saved {
    background: rgba(16, 185, 129, 0.15);
}

/* 未保存 */
.save-status.unsaved .save-icon {
    color: #f59e0b;
}

.save-status.unsaved {
    background: rgba(245, 158, 11, 0.15);
}

/* 保存中 */
.save-status.saving .save-icon {
    color: #3b82f6;
    animation: rotate 1s linear infinite;
}

.save-status.saving {
    background: rgba(59, 130, 246, 0.15);
}

@keyframes rotate {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

/* エラー */
.save-status.error .save-icon {
    color: #ef4444;
}

.save-status.error {
    background: rgba(239, 68, 68, 0.15);
}