/* カレンダー予定登録ツール */

.main-layout {
    display: grid;
    grid-template-columns: 6fr 4fr;
    gap: var(--spacing-xl);
    align-items: start;
}

.right-column {
    position: sticky;
    top: var(--spacing-xl);
}

/* セットアップガイド */
.setup-guide {
    background: #fff8e1;
    border: 1px solid #ffe082;
    border-radius: var(--radius-md);
    padding: var(--spacing-2xl);
    margin-bottom: var(--spacing-xl);
    text-align: center;
}

.setup-icon {
    font-size: 3rem;
    color: #f9a825;
    margin-bottom: var(--spacing-lg);
}

.setup-guide h2 {
    margin-bottom: var(--spacing-md);
    color: var(--text-secondary);
}

.setup-guide p {
    color: var(--text-tertiary);
    margin-bottom: var(--spacing-lg);
    line-height: 1.7;
}

.setup-guide code {
    background: rgba(0,0,0,0.08);
    padding: 2px 6px;
    border-radius: 4px;
    font-family: monospace;
    font-size: 0.9em;
}

.setup-steps {
    text-align: left;
    max-width: 520px;
    margin: 0 auto;
    color: var(--text-tertiary);
    line-height: 1.8;
}

.setup-steps a {
    color: var(--primary-color);
    text-decoration: none;
}

.setup-steps a:hover {
    text-decoration: underline;
}

/* 認証セクション */
.auth-section {
    background: var(--bg-white);
    border: 1px solid var(--border-lighter);
    border-radius: var(--radius-md);
    padding: var(--spacing-xl);
    margin-bottom: var(--spacing-xl);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--spacing-xl);
}

.auth-status {
    display: flex;
    align-items: center;
    gap: var(--spacing-lg);
}

.auth-icon {
    width: 44px;
    height: 44px;
    background: var(--primary-lighter);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
    color: var(--primary-color);
    flex-shrink: 0;
}

.auth-icon.connected {
    background: #e8f5e9;
    color: #43a047;
}

.auth-label {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-bottom: 2px;
}

.auth-desc {
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--text-secondary);
}

.btn-auth {
    display: inline-flex;
    align-items: center;
    gap: var(--spacing-sm);
    padding: 10px 20px;
    background: var(--bg-white);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all var(--transition-fast);
    white-space: nowrap;
    flex-shrink: 0;
}

.btn-auth:hover {
    background: var(--bg-light);
    border-color: var(--primary-color);
    color: var(--primary-color);
}

.btn-auth.btn-logout {
    color: #e53e3e;
    border-color: #feb2b2;
}

.btn-auth.btn-logout:hover {
    background: #fff5f5;
    border-color: #e53e3e;
}

/* フォームセクション */
.form-section {
    background: var(--bg-white);
    border: 1px solid var(--border-lighter);
    border-radius: var(--radius-md);
    padding: var(--spacing-2xl);
}

.section-title {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--text-secondary);
    margin-bottom: var(--spacing-xl);
}

.section-title i {
    color: var(--primary-color);
}

.form-group {
    margin-bottom: var(--spacing-xl);
}

.form-label {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-tertiary);
    margin-bottom: 8px;
}

.form-label i {
    color: var(--primary-color);
    font-size: 0.8rem;
}

.form-input {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    font-size: 0.95rem;
    color: var(--text-primary);
    background: var(--bg-white);
    transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
    box-sizing: border-box;
    font-family: inherit;
}

.form-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: var(--shadow-focus);
}

input[type="date"].form-input {
    cursor: pointer;
}

select.form-input {
    appearance: auto;
    cursor: pointer;
}

/* 自動追加プレビュー */
.auto-preview {
    background: var(--primary-lighter);
    border: 1px solid rgba(77, 208, 225, 0.3);
    border-radius: var(--radius-sm);
    padding: var(--spacing-lg);
    margin-bottom: var(--spacing-xl);
}

.preview-title {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--primary-hover);
    margin-bottom: var(--spacing-md);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.preview-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.preview-item {
    display: flex;
    align-items: center;
    gap: 10px;
    background: var(--bg-white);
    border-radius: 6px;
    padding: 10px 12px;
    border-left: 3px solid transparent;
}

.preview-item--main {
    border-left-color: var(--primary-color);
}

.preview-item--edit {
    border-left-color: #66bb6a;
}

.preview-item--delivery {
    border-left-color: #ffa726;
}

.preview-badge {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: var(--primary-lighter);
    color: var(--primary-hover);
    font-size: 0.75rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.preview-item--edit .preview-badge {
    background: #e8f5e9;
    color: #43a047;
}

.preview-item--delivery .preview-badge {
    background: #fff3e0;
    color: #ef6c00;
}

.preview-event-title {
    flex: 1;
    font-size: 0.88rem;
    font-weight: 500;
    color: var(--text-secondary);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.preview-date {
    font-size: 0.78rem;
    color: var(--text-muted);
    white-space: nowrap;
    flex-shrink: 0;
}

/* 送信ボタン */
.btn-submit {
    width: 100%;
    padding: 14px;
    background: var(--primary-color);
    color: #fff;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--spacing-sm);
    transition: all var(--transition-fast);
    box-shadow: var(--shadow-sm);
}

.btn-submit:hover:not(:disabled) {
    background: var(--primary-hover);
    box-shadow: var(--shadow-md);
    transform: translateY(-1px);
}

.btn-submit:disabled {
    background: var(--border-color);
    color: var(--text-muted);
    cursor: not-allowed;
    box-shadow: none;
    transform: none;
}

.btn-submit.loading {
    pointer-events: none;
    opacity: 0.8;
}

/* 登録履歴 */
.history-section {
    background: var(--bg-white);
    border: 1px solid var(--border-lighter);
    border-radius: var(--radius-md);
    padding: var(--spacing-xl);
}

.history-empty {
    color: var(--text-muted);
    font-size: 0.88rem;
    text-align: center;
    padding: var(--spacing-xl) 0;
}

.history-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.history-entry {
    border: 1px solid var(--border-lighter);
    border-radius: var(--radius-sm);
    padding: 12px;
    background: var(--bg-lighter);
}

.history-entry-title {
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 6px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.history-events {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.history-event {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.78rem;
    color: var(--text-tertiary);
}

.history-event i {
    color: var(--primary-color);
    font-size: 0.7rem;
    flex-shrink: 0;
}

/* トースト */
.copy-toast {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%) translateY(20px);
    background: #333;
    color: #fff;
    padding: 12px 24px;
    border-radius: var(--radius-xl);
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 8px;
    opacity: 0;
    pointer-events: none;
    transition: all 0.3s ease;
    z-index: 1000;
    white-space: nowrap;
}

.copy-toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

.copy-toast.success { background: #43a047; }
.copy-toast.error   { background: #e53e3e; }

/* レスポンシブ */
@media (max-width: 768px) {
    .main-layout {
        grid-template-columns: 1fr;
    }

    .right-column {
        position: static;
    }

    .auth-section {
        flex-direction: column;
        align-items: flex-start;
    }

    .btn-auth {
        width: 100%;
        justify-content: center;
    }
}
