/* 認証関連のスタイル - オフホワイトベースデザイン */

/* 認証セクション */
#auth-section {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    background: #ffffff;
    border: 1px solid #ecf0f1;
    border-radius: 8px;
    color: #2c3e50;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

.auth-buttons {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.user-menu {
    display: flex;
    align-items: center;
    gap: 1rem;
    width: 100%;
}

.user-name {
    font-weight: 500;
    flex: 1;
    color: #34495e;
}

/* ボタンスタイル */
.btn {
    padding: 0.5rem 1rem;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 500;
    text-decoration: none;
    display: inline-block;
    transition: all 0.2s ease;
}

.btn-primary {
    background-color: #1f2937;
    color: white;
    font-weight: 600;
    border-radius: 8px;
}

.btn-primary:hover {
    background-color: #111827;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(31, 41, 55, 0.2);
}

.btn-secondary {
    background-color: #6b7280;
    color: white;
    border-radius: 8px;
    font-weight: 600;
}

.btn-secondary:hover {
    background-color: #4b5563;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(107, 114, 128, 0.15);
}

/* モーダル内のキャンセルボタン専用スタイル */
.modal .btn-secondary {
    background-color: #f8f9fa;
    color: #7f8c8d;
    border: 1px solid #ddd;
    padding: 0.5rem 1rem;
    font-size: 0.9rem;
    font-weight: 500;
}

.modal .btn-secondary:hover {
    background-color: #ecf0f1;
    color: #2c3e50;
    border-color: #bdc3c7;
    transform: translateY(-1px);
}

.btn-outline {
    background-color: transparent;
    color: #34495e;
    border: 1px solid #bdc3c7;
}

.btn-outline:hover {
    background-color: #ecf0f1;
    color: #2c3e50;
    border-color: #95a5a6;
}

/* モーダルスタイル */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(44, 62, 80, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.modal-content {
    background: #ffffff;
    border-radius: 16px;
    width: 90%;
    max-width: 400px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05), 0 20px 25px rgba(0, 0, 0, 0.1);
    border: 1px solid #e5e7eb;
    animation: modalFadeIn 0.3s ease;
}

@keyframes modalFadeIn {
    from {
        opacity: 0;
        transform: scale(0.8);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.modal-header {
    padding: 1.25rem 1.75rem;
    border-bottom: 1px solid #e5e7eb;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #f9fafb;
    border-radius: 16px 16px 0 0;
}

.modal-header h3 {
    margin: 0;
    color: #1f2937;
    font-weight: 600;
    font-size: 1.125rem;
    letter-spacing: -0.025em;
}

.modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: #7f8c8d;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.2s ease;
}

.modal-close:hover {
    color: #2c3e50;
}

.modal-body {
    padding: 1.75rem;
    background: #ffffff;
}

/* フォームスタイル */
.form-group {
    margin-bottom: 1rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.25rem;
    font-weight: 500;
    color: #34495e;
}

.form-group input {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    font-size: 0.9rem;
    transition: all 0.2s ease;
    color: #374151;
    background: #ffffff;
}

.form-group input:focus {
    outline: none;
    border-color: #6b7280;
    box-shadow: 0 0 0 3px rgba(107, 114, 128, 0.1);
}

.form-actions {
    display: flex;
    gap: 0.5rem;
    margin-top: 1.5rem;
}

.form-actions .btn {
    flex: 1;
}

/* エラーメッセージ */
.error-message {
    color: #e74c3c;
    font-size: 0.875rem;
    margin-top: 0.5rem;
    padding: 0.5rem;
    background-color: #fdf2f2;
    border: 1px solid #f5c6cb;
    border-radius: 4px;
}

/* 成功・情報メッセージ */
.message {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 0.75rem 1rem;
    border-radius: 4px;
    font-weight: 500;
    z-index: 1001;
    animation: messageSlideIn 0.3s ease;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

@keyframes messageSlideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.message-success {
    background-color: #f0f8f0;
    color: #27ae60;
    border: 1px solid #27ae60;
}

.message-info {
    background-color: #f8f9fa;
    color: #34495e;
    border: 1px solid #bdc3c7;
}

.message-warning {
    background-color: #fdf6e3;
    color: #e67e22;
    border: 1px solid #e67e22;
}

.message-error {
    background-color: #fdf2f2;
    color: #e74c3c;
    border: 1px solid #e74c3c;
}

/* カスタムCSS セクション */
.custom-css-section {
    display: none; /* デフォルトは非表示 */
    margin-top: 2rem;
    padding: 1.5rem;
    border: 2px solid #ecf0f1;
    border-radius: 8px;
    background-color: #f8f9fa;
}

.custom-css-section h3 {
    color: #2c3e50;
    margin-bottom: 1rem;
    font-weight: 500;
}

.custom-css-section.authenticated {
    display: block;
}

/* レスポンシブ対応 */
@media (max-width: 768px) {
    #auth-section {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }
    
    .user-menu {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
        width: 100%;
    }
    
    .auth-buttons {
        width: 100%;
        justify-content: center;
    }
    
    .modal-content {
        margin: 1rem;
        width: auto;
    }
    
    .form-actions {
        flex-direction: column;
    }
    
    .form-actions .btn {
        width: 100%;
    }
    
    .message {
        right: 10px;
        left: 10px;
        width: auto;
    }
}

/* ダークモード対応（軽微な調整） */
@media (prefers-color-scheme: dark) {
    .modal-content {
        background: #ffffff;
        color: #2c3e50;
    }
    
    .modal-header {
        background: #f8f9fa;
        border-bottom-color: #ecf0f1;
    }
    
    .modal-header h3 {
        color: #2c3e50;
    }
    
    .form-group label {
        color: #34495e;
    }
    
    .form-group input {
        background-color: #ffffff;
        border-color: #ddd;
        color: #2c3e50;
    }
    
    .form-group input:focus {
        border-color: #95a5a6;
        box-shadow: 0 0 0 2px rgba(149, 165, 166, 0.2);
    }
    
    .custom-css-section {
        background-color: #f8f9fa;
        border-color: #ecf0f1;
    }
    
    .custom-css-section h3 {
        color: #2c3e50;
    }
}
